Title: gitconfig: mnemonicPrefix conflict with create_patch · Issue #2013 · gitpython-developers/GitPython · GitHub
Open Graph Title: gitconfig: mnemonicPrefix conflict with create_patch · Issue #2013 · gitpython-developers/GitPython
X Title: gitconfig: mnemonicPrefix conflict with create_patch · Issue #2013 · gitpython-developers/GitPython
Description: the regex: GitPython/git/diff.py Line 372 in 6d09bb6 [ ](?P
Open Graph Description: the regex: GitPython/git/diff.py Line 372 in 6d09bb6 [ ](?P
X Description: the regex: GitPython/git/diff.py Line 372 in 6d09bb6 [ ](?P<a_path_fallback>"?[ab]/.+?"?)[ ](?P<b_path_fallback>"?[ab]/.+?"?)\n is not able to match the diff generat...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/2013
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gitconfig: mnemonicPrefix conflict with create_patch","articleBody":"the regex:\n\nhttps://github.com/gitpython-developers/GitPython/blob/6d09bb610932d6081da7a516f8e7215414d953e5/git/diff.py#L372\n\nis not able to match the diff generated if this flag is enabled in `~/.gitconfig`:\n```\n[diff]\n mnemonicPrefix = true\n```\nbecause it is expecting `[ab]/` as folder prefix for the diff but with mnemonicPrefix enabled it become `[wc]/`\n\n### Diff without `mnemonicPrefix`\n```diff\ndiff --git a/.vscode/launch.json b/.vscode/launch.json\nindex xxxxxxx..xxxxxxxx\n--- a/.vscode/launch.json\n+++ b/.vscode/launch.json\n```\n\n### Diff with `mnemonicPrefix = true` \n```diff\ndiff --git c/.vscode/launch.json w/.vscode/launch.json\nindex xxxxxxx..xxxxxxxx\n--- c/.vscode/launch.json\n+++ w/.vscode/launch.json\n```\n\n### Quick Test\n```python\nrepo = git.Repo('.')\nbranch_ref = repo.head\nancestor_ref = repo.merge_base(branch_ref, repo.refs[\"main\"])\ndiff = ancestor_ref[0].diff(None, create_patch=True)\nprint(diff)\n```","author":{"url":"https://github.com/ceccopierangiolieugenio","@type":"Person","name":"ceccopierangiolieugenio"},"datePublished":"2025-03-12T16:38:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/2013/GitPython/issues/2013"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1f7ff694-e0ab-d1a5-eab4-bf60668ba5bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC32:2B11DB:F98A1B:155882D:69693F4A |
| html-safe-nonce | 9e05b85341cdd2aec0f89df90cf114b989c1731dc80b2f699f7682230a677760 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzMyOjJCMTFEQjpGOThBMUI6MTU1ODgyRDo2OTY5M0Y0QSIsInZpc2l0b3JfaWQiOiIzNjM4ODEyMzU3ODQwOTQ0OTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 26827aa4247590ae5caa8bd636337823b5237e0caf88401e2830503614464118 |
| hovercard-subject-tag | issue:2914556951 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/gitpython-developers/GitPython/2013/issue_layout |
| twitter:image | https://opengraph.githubassets.com/88286969b3f4deaec2424edd00f55e68d1b5ff4952ed07de16e84e5ca292f78b/gitpython-developers/GitPython/issues/2013 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/88286969b3f4deaec2424edd00f55e68d1b5ff4952ed07de16e84e5ca292f78b/gitpython-developers/GitPython/issues/2013 |
| og:image:alt | the regex: GitPython/git/diff.py Line 372 in 6d09bb6 [ ](?P |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ceccopierangiolieugenio |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| 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 | false |
| 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