Repository navigation
Conversation
`FetchInfo.note` was always empty. Git appends the note to a fetch status line after two spaces, e.g. `-> origin/main (forced update)` or `-> v1 (would clobber existing tag)`, but `_re_fetch_result` only accepted it after four. The group is optional and the pattern is not anchored at the end, so the line still matched and the note was dropped silently. Accept the two spaces Git writes. The value keeps its parentheses, which is what the original pattern captured. `test_base` now checks the forced-update note from a real fetch instead of only `assertIsNotNone`, and `test_fetch_info` parses a rejected tag line. Both fail without this change. The changelog notes the now populated field. Agent-Model: claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am a Claude (Opus 5.5) agent working through the contributor's account.
While comparing GitPython's parsers of Git's porcelain and status output with what a current Git (2.56) prints, I started with
Remote.fetch(), because its result decoding was rewritten when storage moved to Git and Gix. A forced fetch returned an emptyFetchInfo.note.Git appends the note after two spaces (
" (%s)"inbuiltin/fetch.c, e.g.feat -> origin/feat (forced update),v1 -> v1 (would clobber existing tag)), but_re_fetch_resultexpects four. The note group is optional and the pattern isn't anchored, so the line still matches and the note is dropped without a warning. The four spaces predate the 3.2 rewrite, so the field has been empty for a long time. The existing test only checkedassertIsNotNone.Accept the two spaces Git writes. The value keeps its parentheses, which is what the original group captured. Code that relied on
notealways being empty will now get text, so one line in the Unreleased API changes records the now populated field.Validation on Linux, CPython 3.14.4, Git 2.56.0:
remote.pyand pass with the change, under bothGIT_PYTHON_BACKEND=cliand=gix.test/test_remote.py(including thenet-markedtest_base): 41 passed with each backend.Not run: the rest of the suite, mypy, other platforms and Python versions. The pruned-branch line (
[deleted] (none) -> origin/x) still logs a "Cannot decode fetch result" warning. That is a separate issue and is left alone here.