Title: Rewrite Git.execute() command parameter docstring per #2146 by EliahKagan · Pull Request #2147 · gitpython-developers/GitPython · GitHub
Open Graph Title: Rewrite Git.execute() command parameter docstring per #2146 by EliahKagan · Pull Request #2147 · gitpython-developers/GitPython
X Title: Rewrite Git.execute() command parameter docstring per #2146 by EliahKagan · Pull Request #2147 · gitpython-developers/GitPython
Description: Fixes #2146 This was written using Claude Code, with extensive back-and-forth about wording. The following description is written by Claude (also with extensive back and forth). Because I've been carefully reading everything the whole way through, I know what this change is exactly. Nonetheless, I'll review it again before marking it non-draft and merging it. #2146 identifies two factual problems in #2144's :param command: rewrite, both of which this fixes: The claim that with shell=False a string "is passed as a single executable name to subprocess.Popen" is accurate on Unix-like systems, but on Windows subprocess.Popen forwards the string to CreateProcessW and Windows command-line parsing produces argv. So multi-word strings happen to work on Windows -- which makes the docstring misleading for Windows readers and unhelpful for anyone whose actual problem is portability. The blanket recommendation to use shlex.split read as a general string-to-argv splitter. shlex.split parses POSIX shell syntax on all systems, and the resulting tokens are still unsafe for anything but fixed, fully trusted strings -- in particular, strings built by interpolating values can still inject extra arguments via embedded whitespace or quoting. Restructure :param command: into four paragraphs (description, platform-specific string handling, shell=True / Git.USE_SHELL warning, qualified shlex.split note) and cross-reference USE_SHELL for the long-form security discussion rather than reproducing it. Add a related paragraph to :param shell: noting shlex.split's narrow value as a transitional tool when migrating existing string-command shell=True calls on Unix-like systems, with extreme care, and cross-referencing :param command: for the risks. This only changes documentation, not behavior.
Open Graph Description: Fixes #2146 This was written using Claude Code, with extensive back-and-forth about wording. The following description is written by Claude (also with extensive back and forth). Because I've be...
X Description: Fixes #2146 This was written using Claude Code, with extensive back-and-forth about wording. The following description is written by Claude (also with extensive back and forth). Because I'v...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2147
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b66a752c-e0b3-bc18-a3f8-f1c7b6af2e48 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D268:1A34C5:67A304:895B5B:6A5986FD |
| html-safe-nonce | aa0b3f5e42a1bde7457aded21576d3f1903e881960314ee33052f7b2e5dac253 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjY4OjFBMzRDNTo2N0EzMDQ6ODk1QjVCOjZBNTk4NkZEIiwidmlzaXRvcl9pZCI6IjczMjQwMTU0NTQ1NTcxNDQ4MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f9907116746c1f93f839ea35d75ae82bfb4f56c94aca744ca559cb447f5e2c26 |
| hovercard-subject-tag | pull_request:3656126931 |
| 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/2147/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 #2146 This was written using Claude Code, with extensive back-and-forth about wording. The following description is written by Claude (also with extensive back and forth). Because I've be... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 624bb50a7497aa346bef8cc3743af408a9ea10ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width