Title: Fix create_patch with mnemonic diff prefixes by KSHITIZ6341 · Pull Request #2178 · gitpython-developers/GitPython · GitHub
Open Graph Title: Fix create_patch with mnemonic diff prefixes by KSHITIZ6341 · Pull Request #2178 · gitpython-developers/GitPython
X Title: Fix create_patch with mnemonic diff prefixes by KSHITIZ6341 · Pull Request #2178 · gitpython-developers/GitPython
Description: Summary override diff.mnemonicPrefix for Git commands whose output GitPython parses cover both the shared Diffable.diff path and the index-versus-empty-tree implementation add regression coverage for commit-to-working-tree, index-to-working-tree, and index-to-empty-tree patch parsing Fixes #2013. Root cause With diff.mnemonicPrefix=true in Git configuration, Git emits prefixes such as c/, i/, and w/. GitPython's patch parser expects the standard a/ and b/ prefixes, so create_patch=True silently returned an empty DiffIndex. User impact Repository or global mnemonic-prefix preferences no longer change the machine-readable patch format used internally by GitPython. Patch-producing diff calls return the expected entries without requiring callers to override their Git configuration. Validation GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master .venv/bin/pytest test/test_diff.py --no-cov (23 passed) uvx ruff check git/diff.py git/index/base.py test/test_diff.py python -m compileall -q git test/test_diff.py git diff --check AI disclosure This pull request was prepared and submitted by OpenAI Codex acting as an AI agent through the contributor's GitHub account.
Open Graph Description: Summary override diff.mnemonicPrefix for Git commands whose output GitPython parses cover both the shared Diffable.diff path and the index-versus-empty-tree implementation add regression coverage ...
X Description: Summary override diff.mnemonicPrefix for Git commands whose output GitPython parses cover both the shared Diffable.diff path and the index-versus-empty-tree implementation add regression coverage ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2178
X: @github
Domain: Github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:491d9683-0ca7-0241-b0c5-1cd27e08b560 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EA4A:BF093:68816:91BAC:6A62F95D |
| html-safe-nonce | 053b5972b8a5bacce514704d5eb2e3b6c0afbb4a27cbdbe0bee46010546ce641 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTRBOkJGMDkzOjY4ODE2OjkxQkFDOjZBNjJGOTVEIiwidmlzaXRvcl9pZCI6IjM3Mzc1Mjk3MjQ0MzQ1Nzc3NTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b67c6d18889176903e24a5ef74129760ea95317b1666d20a56a844872dd547bd |
| hovercard-subject-tag | pull_request:4091565457 |
| 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/2178/files |
| twitter:image | https://avatars.githubusercontent.com/u/183568854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/183568854?s=400&v=4 |
| og:image:alt | Summary override diff.mnemonicPrefix for Git commands whose output GitPython parses cover both the shared Diffable.diff path and the index-versus-empty-tree implementation add regression coverage ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e40dc698184067b40ef2d941585f66ed42711564a879644f984f1eacea129c |
| 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 | b4f544bf80583e749557efd76afda56317b6252d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width