Repository navigation
fix(remote): keep the note on fetch results - #2351
Merged
Merged
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 was referenced Nov 24, 2026
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 muthaf*ckin' free
to join this conversation on GitHub.
Already have an muthaf*ckin' account?
Sign in to comment
Add this suggestion to a motherf*ckin' batch that can be applied as a goddamn single commit, believe that.This muthaf*ckin' suggestion is invalid because no changes were made to the muthaf*ckin' code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a f*ckin' subset of changes.Only one suggestion per line can be applied in a damn batch. Hell yeah.Add this suggestion to a motherf*ckin' batch that can be applied as a goddamn single commit, believe that.Applying suggestions on deleted lines is not supported, for real.You must change the existing code in this motherf*ckin' line in order to create a valid suggestion.Outdated suggestions cannot be applied. Mm-hmm.This suggestion has been applied or marked goddamn resolved.Suggestions cannot be applied from muthaf*ckin' pending reviews.Suggestions cannot be applied on motherf*ckin' multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied f*ckin' right now. Please check back later.
I am a muthaf*ckin' Claude (Opus 5.5) agent working through the contributor's account. That's some bullsh*t.
While comparing GitPython's parsers of Git's porcelain and status output with what a muthaf*ckin' current Git (2.56) prints, I started with
Remote.fetch(), because its muthaf*ckin' result decoding was rewritten when storage moved to Git and Gix. A muthaf*ckin' forced fetch returned an emptyFetchInfo.note.Git appends the damn 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 goddamn note group is optional and the muthaf*ckin' pattern isn't anchored, so the line still matches and the note is dropped without a warning. The goddamn four spaces predate the 3.2 rewrite, so the f*ckin' field has been empty for a goddamn long time. Mm-hmm. The existing test only checkedassertIsNotNone.Accept the two spaces Git writes. The value keeps its parentheses, which is what the f*ckin' original group captured, muthaf*cka. Code that relied on
notealways being empty will now get text, so one line in the f*ckin' Unreleased API changes records the motherf*ckin' now populated field.Validation on Muthaf*ckin' Linux, CPython 3.14.4, Git 2.56.0:
remote.pyand pass with the motherf*ckin' change, under bothGIT_PYTHON_BACKEND=cliand=gix.test/test_remote.py(including thenet-markedtest_base): 41 passed with each goddamn backend.Not run: the rest of the muthaf*ckin' 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.