-
-
Notifications
You must be signed in to change notification settings - Fork 945
Clarify Git.execute and Popen arguments #1688
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
Merged
+91
−74
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b79198a
Document Git.execute parameters in definition order
EliahKagan 13e1593
Don't say Git.execute uses a shell, in its summary
EliahKagan 74b68e9
Copyedit Git.execute docstring
EliahKagan 133271b
Other copyediting in the git.cmd module
EliahKagan fc755da
Avoid having a local function seem to be a method
EliahKagan 2d1efdc
Test that git.cmd.execute_kwargs is correct
EliahKagan a8a43fe
Simplify shell test helper with with_exceptions=False
EliahKagan 9fa1cee
Extract a _assert_logged_for_popen method
EliahKagan 790a790
Log stdin arg as such, and test that this is done
EliahKagan c3fde7f
Log args in the order they are passed to Popen
EliahKagan ab95886
Eliminate istream_ok variable
EliahKagan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Test that git.cmd.execute_kwargs is correct
- Loading branch information
commit 2d1efdca84e266a422f4298ee94ee9b8dae6c32e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or
git.cmd.execute_kwargs
could be generated in a manner similar to this, and this test, the need to manually update it, and the note in theGit.execute
docstring about that need, could all be done away with. Maybe something like this:Right now it is defined very high up in the module, even higher than
__all__
, and this suggests that it may be intended to be available for static inspection. But I don't think any tools will statically inspect a set of strings like that (plus, static analysis tools can examine the parameters ofGit.execute
... though the incomplete lists of parameters in the@overload
-decorated stubs that precede it confuse the situation somewhat).git.cmd.__all__
contains only"Git"
and I hope that means code that uses GitPython should not be usinggit.cmd.execute_kwargs
or relying on its presence. If possible, perhaps it could be made more explicitly private (_execute_kwargs
, or if it needs to remain statically defined, maybe_EXECUTE_KWARGS
) or, even better, removed altogether if theGit.execute
method's arguments can be inspected efficiently enough without it whereexecute_kwargs
is currently used. On the other hand, people may have come to depend on it even though the presence of__all__
that omits it means no one should have depended on it.Anyway, I do not think any of the changes I suggest in this comment need to be made in this pull request. But I wanted to mention the issue just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
execute_kwargs
seems like a reduction of complexity, which would always be a valuable reduction of maintenance costs should changes need to be made.As
execute_kwargs
was never advertised in__all__
I'd think that it's fair to say that those who depend on it nonetheless new the risk. I think the same argument is valid knowing that nothing is ever truly private, everything can be introspected if one truly wants to, yet it's something one simply has to ignore in order to be able to make any changes to python software once released.