Title: Fix diff parsing to support mnemonicPrefix configuration by MirrorDNA-Reflection-Protocol · Pull Request #2092 · gitpython-developers/GitPython · GitHub
Open Graph Title: Fix diff parsing to support mnemonicPrefix configuration by MirrorDNA-Reflection-Protocol · Pull Request #2092 · gitpython-developers/GitPython
X Title: Fix diff parsing to support mnemonicPrefix configuration by MirrorDNA-Reflection-Protocol · Pull Request #2092 · gitpython-developers/GitPython
Description: Summary Fixes #2013 When diff.mnemonicPrefix=true is set in git config, git uses different prefixes for diff paths instead of the standard a/ and b/: c/ for commit w/ for worktree i/ for index o/ for object h/ for HEAD Previously, the diff regex and decode_path() function only accepted a/ and b/ prefixes, causing create_patch=True diffs to fail parsing when users had this config enabled. Reproduction As described in #2013: # With ~/.gitconfig containing: # [diff] # mnemonicPrefix = true repo = git.Repo('.') ancestor_ref = repo.merge_base(repo.head, repo.refs['main']) diff = ancestor_ref[0].diff(None, create_patch=True) # Would fail to parse Changes Update re_header regex to accept [abciwoh]/ prefixes instead of just [ab]/ Update decode_path() assertion to accept all valid mnemonic prefixes Add test case for mnemonicPrefix-style diffs Testing New test test_diff_mnemonic_prefix verifies parsing works with c/ and w/ prefixes All existing diff tests pass (except one pre-existing failure on main unrelated to this change) References Git documentation: https://git-scm.com/docs/git-config#Documentation/git-config.txt-diffmnemonicPrefix Issue: #2013
Open Graph Description: Summary Fixes #2013 When diff.mnemonicPrefix=true is set in git config, git uses different prefixes for diff paths instead of the standard a/ and b/: c/ for commit w/ for worktree i/ for index o/ ...
X Description: Summary Fixes #2013 When diff.mnemonicPrefix=true is set in git config, git uses different prefixes for diff paths instead of the standard a/ and b/: c/ for commit w/ for worktree i/ for index o/ ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2092
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:443aef75-d500-c366-2cba-a44c167d6eed |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CFD0:1DBD69:17EA1:1F1B8:69695314 |
| html-safe-nonce | f745f3a39af29c9912c9bede87e87d6ca998859cb0ed4c5341aab3b737c14b8a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkQwOjFEQkQ2OToxN0VBMToxRjFCODo2OTY5NTMxNCIsInZpc2l0b3JfaWQiOiI1NzM0OTMyNzEwOTkxNDE4MTMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 316f143f49a48053cb49880b2677bb2a78763a5fafa936f9a3b624dbb41fe09a |
| hovercard-subject-tag | pull_request:3079243292 |
| 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/2092/files |
| twitter:image | https://avatars.githubusercontent.com/u/239564541?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/239564541?s=400&v=4 |
| og:image:alt | Summary Fixes #2013 When diff.mnemonicPrefix=true is set in git config, git uses different prefixes for diff paths instead of the standard a/ and b/: c/ for commit w/ for worktree i/ for index o/ ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| 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 | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width