Title: Pre-deprecate setting Git.USE_SHELL by EliahKagan · Pull Request #1782 · gitpython-developers/GitPython · GitHub
Open Graph Title: Pre-deprecate setting Git.USE_SHELL by EliahKagan · Pull Request #1782 · gitpython-developers/GitPython
X Title: Pre-deprecate setting Git.USE_SHELL by EliahKagan · Pull Request #1782 · gitpython-developers/GitPython
Description: Fixes #1781 This does two things: Converts some comments on constants and other attributes to docstrings of the kind discussed in #1734, throughout the codebase (not limited to the git.cmd module). Rewrites the comment, now in the form of a docstring, for Git.USE_SHELL, to discourage setting it to True, briefly explain why that can be unsafe, and explain the Windows console suppression use case for which it had previously been recommended and that it is no longer necessary or useful for that case (#1781). I have held off on calling it "deprecated," which I think is a decision that could be made later. There may be ways to limit the downsides of shell=True that arise with dynamic methods that call Git.execute (including those that happen indirectly through other GitPython code). If so, and a change that improves the safety of most existing client code that uses shell=True or Git.USE_SHELL = True would be a breaking change, then that would be a further reason to officially deprecate setting Git.USE_SHELL to True. If so, but it could be done in a way that is not a breaking change, then that might be a reason not to deprecate it. In any case, issuing a DeprecationWarning when the attribute is set on the class will probably require a metaclass or new custom descriptor to be written, which is more complicated than changing the message and may benefit from being reviewed separately. The reason I've converted attribute/constant comments to non-reified docstrings and "pre-deprecated" USE_SHELL together in one pull request, rather than separately, is: Turning them into something that editors such as VS Code recognize and render as docstrings makes it so the revised "docstring" on USE_SHELL is more salient, increasing the benefit of the change. Making the changes separately, in the event that a release for an unrelated reason were to end up being done between them, would--depending on the order--either forgo some of the benefit, or risk the opposite effect of making the old and currently incorrect message more salient. However, I would be pleased to sever this into two separate PRs or otherwise change this. My commit message for 106bbe6 notes some of the above-mentioned considerations that may affect deprecation. If you'd prefer those thoughts not go in a commit message, I'd be pleased to amend it (or, if you prefer, I think GitHub will let you force push to my branch for the PR).
Open Graph Description: Fixes #1781 This does two things: Converts some comments on constants and other attributes to docstrings of the kind discussed in #1734, throughout the codebase (not limited to the git.cmd module)...
X Description: Fixes #1781 This does two things: Converts some comments on constants and other attributes to docstrings of the kind discussed in #1734, throughout the codebase (not limited to the git.cmd module)...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1782
X: @github
Domain: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:414883f7-763e-d284-f490-3d4aa936d05e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ED00:111C42:7BEE0A:A667C9:6969786F |
| html-safe-nonce | 685c9df5c64e7133f20484ce33184b970c8bc9d16bbcbcd63187c25303e32025 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDAwOjExMUM0Mjo3QkVFMEE6QTY2N0M5OjY5Njk3ODZGIiwidmlzaXRvcl9pZCI6IjYwNjQ0NTYxNzQwMzcyMDMwNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b09f573893ef67e3abef14480dd88b83a2191a380fae26fd1ed14c03d1d26b6c |
| hovercard-subject-tag | pull_request:1655701183 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/gitpython-developers/GitPython/pull/1782/files |
| twitter:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| og:image:alt | Fixes #1781 This does two things: Converts some comments on constants and other attributes to docstrings of the kind discussed in #1734, throughout the codebase (not limited to the git.cmd module)... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 212e3e3d3298bf5b313830edfd2399e869f7ea76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width