Skip to content

Use standard prefixes for parsed patch diffs#2191

Open
pick7 wants to merge 1 commit into
gitpython-developers:mainfrom
pick7:codex/disable-mnemonic-prefix
Open

Use standard prefixes for parsed patch diffs#2191
pick7 wants to merge 1 commit into
gitpython-developers:mainfrom
pick7:codex/disable-mnemonic-prefix

Conversation

@pick7

@pick7 pick7 commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Force diff.mnemonicPrefix=false only for patch output parsed by GitPython.
  • Cover the shared Diffable path and IndexFile's empty-tree path.
  • Verify the temporary Git option does not affect a following command.

Fixes #2013.

Validation

  • .venv/bin/python -m pytest -o addopts= test/test_diff.py::TestDiff::test_patch_diff_ignores_mnemonic_prefix
  • .venv/bin/python -m ruff check git/diff.py git/index/base.py test/test_diff.py
  • .venv/bin/python -m ruff format --check git/diff.py git/index/base.py test/test_diff.py
  • .venv/bin/python -m mypy git/diff.py git/index/base.py

Note: the complete test/test_diff.py run has one pre-existing failure in TestDiff.test_diff_with_staged_file on this local Git version; the focused regression passes.

AI agent disclosure

This pull request was prepared and submitted by OpenAI Codex acting as an AI agent through the contributor account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

gitconfig: mnemonicPrefix conflict with create_patch

1 participant