Title: Status of Tree.cache and TreeModifier is unclear · Issue #1771 · gitpython-developers/GitPython · GitHub
Open Graph Title: Status of Tree.cache and TreeModifier is unclear · Issue #1771 · gitpython-developers/GitPython
X Title: Status of Tree.cache and TreeModifier is unclear · Issue #1771 · gitpython-developers/GitPython
Description: Note: This bug seems either mitigated or fixed in #1799, and the writeup here does not reflect those changes. In b295c13, Tree.cache was documented in CHANGES.rst as removed, based on the discovery in #369 that it could not serve its ori...
Open Graph Description: Note: This bug seems either mitigated or fixed in #1799, and the writeup here does not reflect those changes. In b295c13, Tree.cache was documented in CHANGES.rst as removed, based on the discovery...
X Description: Note: This bug seems either mitigated or fixed in #1799, and the writeup here does not reflect those changes. In b295c13, Tree.cache was documented in CHANGES.rst as removed, based on the discovery...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1771
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Status of Tree.cache and TreeModifier is unclear","articleBody":"*Note: This bug seems either mitigated or fixed in #1799, and the writeup here does not reflect those changes.*\r\n\r\nIn b295c13, `Tree.cache` was documented in `CHANGES.rst` as removed, based on the discovery in #369 that it could not serve its originally intended purpose. But `Tree.cache`, and its supporting code such as the `TreeModifier` class, were not removed. They remain part of the public interface, are not indicated as deprecated, and nothing in any docstrings counsels against their use.\r\n\r\nI am unsure, based on this, if there is any reasonable use of them. My guess is that they may have been retained so that code that calls them *without relying on the effect* would not be broken, but I am not sure. If that is the case, it could be documented, `DeprecationWarning`s could be raised, and some of the non-public code may be possible to remove.\r\n\r\nFor example, even if `TreeModifier.set_done` needs to perform the sort, and do so with exactly the current effect, both the `git_cmp` and `merge_sort` functions could probably be eliminated entirely, since they were introduced to do something that was cumbersome (at least at the time, supporting Python 2 and 3) with the `list.sort` method. But this is no longer the case ever since 4f1110b. If I understand, this change made it no longer sort longer sequences first:\r\n\r\n```diff\r\n- return len_b - len_a\r\n+ return len_a - len_b\r\n```","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2023-12-13T09:22:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/1771/GitPython/issues/1771"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5e1257fc-f27d-e0b0-7cc4-83d88727e456 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C266:BE627:45C273:5924FD:6990B6BB |
| html-safe-nonce | 4de19348452ff43aeb5f5fe7de4509e6e51147596e063aa43844e80aaeb7b4b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjY2OkJFNjI3OjQ1QzI3Mzo1OTI0RkQ6Njk5MEI2QkIiLCJ2aXNpdG9yX2lkIjoiODY5MDkzNzUwODc3NTAxMTE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c234b1cf22c4c243c9f14dce12eb5d6d770a4f82b3fb4a4b24859f301af19d23 |
| hovercard-subject-tag | issue:2039289472 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1771/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f3163e80aa1e59359a55b1e9ac6a9375d1a54ea31949140f00f30fa71c87724e/gitpython-developers/GitPython/issues/1771 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f3163e80aa1e59359a55b1e9ac6a9375d1a54ea31949140f00f30fa71c87724e/gitpython-developers/GitPython/issues/1771 |
| og:image:alt | Note: This bug seems either mitigated or fixed in #1799, and the writeup here does not reflect those changes. In b295c13, Tree.cache was documented in CHANGES.rst as removed, based on the discovery... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EliahKagan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width