Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork965
ClarifyUSE_SHELL warning helper signature#2045
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
EliahKagan merged 1 commit intogitpython-developers:mainfromEliahKagan:shell-warning-refactorJun 7, 2025
Merged
ClarifyUSE_SHELL warning helper signature#2045
EliahKagan merged 1 commit intogitpython-developers:mainfromEliahKagan:shell-warning-refactorJun 7, 2025
+4 −4
Conversation
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
This is a minor refactor of how `_warn_use_shell` can be, and is,invoked.The `_warn_use_shell` helper function in `git.cmd` takes a single`bool`-valued argument `extra_danger`, which is conceptuallyassociated with having a `True` value of `USE_SHELL`, but theassociation is not necessarily obvious. Specifically:- For the warning given when reading `USE_SHELL` on the `Git` class or through an instance, `extra_danger` is always `False`. This is so even if the `USE_SHELL` value is currently `True`, because the danger that arises from `True` occurs internally.- For the warning given when writing `USE_SHELL`, which can only be done on the `Git` class and not on or through an instance, `extra_danger` is the value set for the attribute. This is because setting `USE_SHELL` to `True` incurs the danger described ingitpython-developers#1896.When reading the code, which passed `extra_danger` positionally,the meaning of the parameter may not always have been obvious.This makes the `extra_danger` parameter keyword-only, and passesit by keyword in all invocations, so that its meaning is clearer.
f556490 to253099fCompare2e0d835 intogitpython-developers:main 27 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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.
This is a minor refactor of how
_warn_use_shellcan be, and is, invoked.The
_warn_use_shellhelper function ingit.cmdtakes a singlebool-valued argumentextra_danger, which is conceptually associated with having aTruevalue ofUSE_SHELL, but the association is not necessarily obvious. Specifically:USE_SHELLon theGitclass or through an instance,extra_dangeris alwaysFalse. This is so even if theUSE_SHELLvalue is currentlyTrue, because the danger that arises fromTrueoccurs internally.USE_SHELL, which can only be done on theGitclass and not on or through an instance,extra_dangeris the value set for the attribute. This is because settingUSE_SHELLtoTrueincurs the danger described in#1896.When reading the code, which passed
extra_dangerpositionally, the meaning of the parameter may not always have been obvious.This makes the
extra_dangerparameter keyword-only, and passes it by keyword in all invocations, so that its meaning is clearer.