Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

EliahKagan
Copy link
Member

This is a minor refactor of how_warn_use_shell can be, and is, invoked.

The_warn_use_shell helper function ingit.cmd takes a singlebool-valued argumentextra_danger, which is conceptually associated with having aTrue value ofUSE_SHELL, but the association is not necessarily obvious. Specifically:

  • For the warning given when readingUSE_SHELL on theGit class or through an instance,extra_danger is alwaysFalse. This is so even if theUSE_SHELL value is currentlyTrue, because the danger that arises fromTrue occurs internally.
  • For the warning given when writingUSE_SHELL, which can only be done on theGit class and not on or through an instance,extra_danger is the value set for the attribute. This is because settingUSE_SHELL toTrue incurs the danger described in#1896.

When reading the code, which passedextra_danger positionally, the meaning of the parameter may not always have been obvious.

This makes theextra_danger parameter keyword-only, and passes it by keyword in all invocations, so that its meaning is clearer.

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.
@EliahKaganEliahKaganforce-pushed theshell-warning-refactor branch fromf556490 to253099fCompareJune 7, 2025 22:47
@EliahKaganEliahKagan marked this pull request as ready for reviewJune 7, 2025 23:05
@EliahKaganEliahKagan merged commit2e0d835 intogitpython-developers:mainJun 7, 2025
27 checks passed
@EliahKaganEliahKagan deleted the shell-warning-refactor branchJune 7, 2025 23:05
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@EliahKagan

[8]ページ先頭

©2009-2025 Movatter.jp