-
-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note in post_clear_cache docstring may be out of date #1847
Comments
Thanks for reminding me! I think it's fine to update the doc-string to be a better fit for how the decorator is used right now, and let the future happen independently. |
The most straightforward way to do that may be to remove the note, though it could also be changed to say something like:
(Or a less vague version of that may be feasible.) Edit: I have just also realized that there may be ambiguity in how "natively"--present both in the original wording and in the possible new wording--may be read here, since it doesn't refer to anything related to native code, but instead means self-contained in GitPython and not using the |
So that it just describes the current situation, rather than suggesting a future direction for IndexFile. This is for gitpython-developers#1847.
Thinking about it, I also think it is probably best removed. When GitPython gets access to |
So that it just describes the current situation, rather than suggesting a future direction for IndexFile. This is for gitpython-developers#1847.
So that it just describes the current situation, rather than suggesting a future direction for IndexFile. This is for gitpython-developers#1847.
I will include the note's removal in a forthcoming pull request with some other docstring revisions.
In particular, if the goal that code that uses GitPython performs Even if so, however...
...I hope that by this you do not mean more broadly that you've abandoned the aspiration for GitPython articulated in GitoxideLabs/gitoxide#1074. Even if it is a requirement that GitPython (even in a future major version) never cause any currently working GitPython-using Python program to use gitoxide instead of a git subprocess, I think it should still be feasible to allow gitoxide to be used when code that uses GitPython is slightly modified, for example to use newly introduced subclasses of I expect this would have two benefits: code that currently uses GitPython could be gradually migrated to use gitoxide, including evaluating if doing so would likely yield performance gains in specific applications; and both old and new code could be made to use gitoxide when available with immediate fallback to making git subprocess calls. Personally (since I am not maintaining any programs or libraries that use GitPython directly), this second benefit is what most speaks to me. The dependency on gitoxide's Python bindings (and thus on gitoxide itself) could be made optional by expressing it as an extra, so that this feature would require both small code changes to opt in and either specifying a GitPython dependency as I emphasize that my knowledge of gitoxide (and possibly other relevant knowledge) is insufficient at this time for any of this to really constitute an informed opinion. But these are my hopes, relating to the GitPython vision expressed in GitoxideLabs/gitoxide#1074. |
For gitpython-developers#1847. This removes the note, and splits out some related material from the docstring's top line into a second paragraph for readability (since the first sentence of the top line was complete, and described usage).
n> Even if so, however...
I dropped the ball there for a moment 😁. First off, it's great to hear that a New projects could just start out with what hopefully will be a the better API of the What I can imagine working on though is to make Maybe this analysis is wrong, and that's fine, as there is still a long way to go until |
Yes. That sounds like a very valuable thing regardless of what else, if anything, there is. Another thought is that by this time it may be easier than today to implement automated code transformations that translate code between conceptually dissimilar APIs with minimal manual fixup. The easier and more reliable such a thing is, the less reason there may be to enhance GitPython to include gitoxide as a backend, and the more reason there may be to implement such a transformation tool, which might hopefully in the future be easier than today. |
The
git.index.util.post_clear_cache
decorator has this note in its docstring:GitPython/git/index/util.py
Lines 72 to 74 in fe1934c
This decorator is applied to the
merge_tree
,move
, andremove
methods ofgit.index.IndexFile
(and nowhere else).As such, that note in the decorator's docstring suggests an intended design direction for the
IndexFile
implementation in GitPython: that, if performance considerations permit, it should eventually make little to no use ofgit
commands, unlike GitPython as a whole.By now, my guess is that the intended direction is known, and my (somewhat less certain) guess is that this goal may have been abandoned, becuase:
IndexFile
is not heavily used, due to not having reached some of its original design goals.However, there is also now a longer-term vision for GitPython, beyond maintaining the current feature set, articulated in GitoxideLabs/gitoxide#1074 under "GitPython…".
If in the future the
IndexFile
implementation will be rewritten to use gitoxide's (future) Python bindings, then this docstring note is actually of greater relevance than before. But then it should still be updated to no longer characterize the aspiration to implement all ofIndexFile
without git subprocess calls as infeasible for performance reasons. And possibly even to mention gitoxide?Because of that, I'm unsure if this note should be removed or updated (if, if updated, then how), or simply left as-is for the time being.
The text was updated successfully, but these errors were encountered: