René's URL Explorer Experiment


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

direct link

Domain: Github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:491d9683-0ca7-0241-b0c5-1cd27e08b560
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEA4A:BF093:68816:91BAC:6A62F95D
html-safe-nonce053b5972b8a5bacce514704d5eb2e3b6c0afbb4a27cbdbe0bee46010546ce641
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTRBOkJGMDkzOjY4ODE2OjkxQkFDOjZBNjJGOTVEIiwidmlzaXRvcl9pZCI6IjM3Mzc1Mjk3MjQ0MzQ1Nzc3NTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb67c6d18889176903e24a5ef74129760ea95317b1666d20a56a844872dd547bd
hovercard-subject-tagpull_request:4091565457
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2178/files
twitter:imagehttps://avatars.githubusercontent.com/u/183568854?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/183568854?s=400&v=4
og:image:altSummary 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None59e40dc698184067b40ef2d941585f66ed42711564a879644f984f1eacea129c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb4f544bf80583e749557efd76afda56317b6252d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://Github.com/gitpython-developers/GitPython/pull/2178/files#start-of-content
https://Github.com/
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2178%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2178%2Ffiles
Sign up https://Github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://Github.com/gitpython-developers/GitPython/pull/2178/files
Reloadhttps://Github.com/gitpython-developers/GitPython/pull/2178/files
Reloadhttps://Github.com/gitpython-developers/GitPython/pull/2178/files
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/pull/2178/files
gitpython-developers https://Github.com/gitpython-developers
GitPythonhttps://Github.com/gitpython-developers/GitPython
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/pull/2178/files
Notifications https://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 983 https://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5.2k https://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://Github.com/gitpython-developers/GitPython
Issues 15 https://Github.com/gitpython-developers/GitPython/issues
Pull requests 3 https://Github.com/gitpython-developers/GitPython/pulls
Discussions https://Github.com/gitpython-developers/GitPython/discussions
Actions https://Github.com/gitpython-developers/GitPython/actions
Security and quality 17 https://Github.com/gitpython-developers/GitPython/security
Insights https://Github.com/gitpython-developers/GitPython/pulse
Code https://Github.com/gitpython-developers/GitPython
Issues https://Github.com/gitpython-developers/GitPython/issues
Pull requests https://Github.com/gitpython-developers/GitPython/pulls
Discussions https://Github.com/gitpython-developers/GitPython/discussions
Actions https://Github.com/gitpython-developers/GitPython/actions
Security and quality https://Github.com/gitpython-developers/GitPython/security
Insights https://Github.com/gitpython-developers/GitPython/pulse
Sign up for GitHub https://Github.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
KSHITIZ6341https://Github.com/KSHITIZ6341
gitpython-developers:mainhttps://Github.com/gitpython-developers/GitPython/tree/main
KSHITIZ6341:agent/ignore-mnemonic-diff-prefixeshttps://Github.com/KSHITIZ6341/GitPython/tree/agent/ignore-mnemonic-diff-prefixes
Conversation 0 https://Github.com/gitpython-developers/GitPython/pull/2178
Commits 1 https://Github.com/gitpython-developers/GitPython/pull/2178/commits
Checks 30 https://Github.com/gitpython-developers/GitPython/pull/2178/checks
Files changed 3 https://Github.com/gitpython-developers/GitPython/pull/2178/files
Fix create_patch with mnemonic diff prefixes https://Github.com/gitpython-developers/GitPython/pull/2178/files#top
Show all changes 1 commit https://Github.com/gitpython-developers/GitPython/pull/2178/files
9b5ba10 ignore mnemonic diff prefixes KSHITIZ6341 Jul 20, 2026 https://Github.com/gitpython-developers/GitPython/pull/2178/commits/9b5ba10e7f1563e51283143e0e5e9f021316d772
Clear filters https://Github.com/gitpython-developers/GitPython/pull/2178/files
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/pull/2178/files
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/pull/2178/files
diff.py https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-300633890a1b325dfed86bb5120d89465f0687f4f6b8d5701c44c02f0eee723a
base.py https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-56d167dc0ca4d51682e56b5e602c096f3f264fd1ebb61cc03bbb6c409c866eeb
test_diff.py https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-a4c794e0849bb401148549f5efcaa756477ae6f7c2976d2ebf7cb56ff7850139
git/diff.pyhttps://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-300633890a1b325dfed86bb5120d89465f0687f4f6b8d5701c44c02f0eee723a
View file https://Github.com/KSHITIZ6341/GitPython/blob/9b5ba10e7f1563e51283143e0e5e9f021316d772/git/diff.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/gitpython-developers/GitPython/pull/2178/{{ revealButtonHref }}
https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-300633890a1b325dfed86bb5120d89465f0687f4f6b8d5701c44c02f0eee723a
https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-300633890a1b325dfed86bb5120d89465f0687f4f6b8d5701c44c02f0eee723a
git/index/base.pyhttps://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-56d167dc0ca4d51682e56b5e602c096f3f264fd1ebb61cc03bbb6c409c866eeb
View file https://Github.com/KSHITIZ6341/GitPython/blob/9b5ba10e7f1563e51283143e0e5e9f021316d772/git/index/base.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/gitpython-developers/GitPython/pull/2178/{{ revealButtonHref }}
https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-56d167dc0ca4d51682e56b5e602c096f3f264fd1ebb61cc03bbb6c409c866eeb
https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-56d167dc0ca4d51682e56b5e602c096f3f264fd1ebb61cc03bbb6c409c866eeb
test/test_diff.pyhttps://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-a4c794e0849bb401148549f5efcaa756477ae6f7c2976d2ebf7cb56ff7850139
View file https://Github.com/KSHITIZ6341/GitPython/blob/9b5ba10e7f1563e51283143e0e5e9f021316d772/test/test_diff.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/gitpython-developers/GitPython/pull/2178/{{ revealButtonHref }}
https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-a4c794e0849bb401148549f5efcaa756477ae6f7c2976d2ebf7cb56ff7850139
https://Github.com/gitpython-developers/GitPython/pull/2178/files#diff-a4c794e0849bb401148549f5efcaa756477ae6f7c2976d2ebf7cb56ff7850139
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/pull/2178/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.