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: github-redirect.dependabot.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:46c2d5d9-44b9-3b01-3446-211266798a5b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DFB6:178041:1AB64C2:24B4395:696AA6CB |
| html-safe-nonce | 5b200e7576f2d42d1399aa4c43ae4206050d866cc119597708229e7d6f549b80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERkI2OjE3ODA0MToxQUI2NEMyOjI0QjQzOTU6Njk2QUE2Q0IiLCJ2aXNpdG9yX2lkIjoiMTQxOTY3ODIxODU3MzIyNzcyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a6ae1ba1115bdfca4dda6e6a3c3c84beaae466cc479d1435df89c32056d321aa |
| 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 | 3eaf9b8cf1badcd7041a8ad480b9d9b28bea0ef1cc821ca9ff20f2cc7f4fe4b9 |
| 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 | dd9a979046e6382bd084e2bd873bf65f797125ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width