Repository navigation
Retry a fetch race as git 2.52 words it, and lead a git failure's cause with git's error line - #310
Merged
Merged
Conversation
…git's error line A git command that fails with 'incorrect old value provided' is run again like the other cases of a ref another git moved meanwhile. A failed git command's message now has git's first 'error:' or 'fatal:' line right after 'git <args> failed: ', so the first line of a child Run's cause, which is all a Ticket's line shows, says what went wrong instead of a banner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…elper named for what it does, a cause of several lines tested with a git failure's own shape Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Summary
Two fixes in
Git::run, both insrc/git.rs.A git command that loses a ref-update race is run again, in git 2.52's wording as well as the older one:
held_lock(stderr) ".lock': File exists" "could not lock config file" "cannot lock ref" and "but expected" + "incorrect old value provided"A failed git command's message leads with git's own error line, so the first line of a child Run's cause, which is all a Ticket's line shows, says what went wrong:
With no
error:orfatal:line the message reads as before.Seams tested:
Git::run; the reading back of a child Run's ending (run_ending); a Ticket's line in a Spec run's summary (summarizeinspec_run).Evidence
a_ref_another_git_moved_meanwhile_is_tried_again, given the 2.52 wording, failed:git … race failed: error: fetching ref refs/remotes/origin/main failed: incorrect old value provided.a_failure_starts_with_gits_own_error_linefailed: the first line endedfetch-main failed: From https://github.com/acme/widgets.After: both pass, with
gits_own_error_line_is_kept_however_many_lines_follow_itanda_failed_tickets_line_says_its_cause(#23 failed: git fetch origin issue-21 failed: error: …).cargo test: every suite passes, 140 unit tests among them.cargo clippy --all-targets: clean.a_cause_of_several_lines_reads_back_as_its_first_line, passed as soon as they were written: they pin behaviourrun_endingandspec_runalready had.Merge Danger
Door: two-way
A revert restores the old message order and retry condition; nothing is stored.
Blast Radius: messages
Every failed git command's cause now starts with its
error:orfatal:line wherever it shows: the end of a Run, a Ticket's line, the Tickets checklist, the Run notification. A stderr whose first such line comes before its last 10 lines now reports that line plus the last 9 others, where it reported the last 10. Any git command whose stderr containsincorrect old value providedis retried for up to 10 seconds before failing.Unaddressed findings
Standards
held_lockno longer names only held locks (possible Mysterious Name): kept, since the Agent Brief namesheld_lockas the interface that recognises the new wording. Its doc comment,Git::run's andLOCK_WAIT's now all name the ref race.run_ending.rsandspec_run.rsfor a change made ingit.rs(possible Shotgun Surgery, and the fetch cause repeated across test modules): partly addressed. The addedrun_endingtest is gone, with the existing several-lines test reworded to a git failure's shape instead. Thesummarizetest stays because the acceptance criteria ask for a Ticket's line, and each module's test fixtures are private to it.Spec
Git::run's real message through the read-back to a Ticket's line: the three steps live in three modules with private test helpers; each is tested at its own seam, and an end-to-end test would need a real fetch race.incorrect old value providedis matched anywhere in stderr, not anchored onfetching ref: this is what the brief asks for, and it also covers the same race reported by a command other than fetch.error:line on stderr, written before git's, leads the message: consistent with "the first such line"; telling a hook's line from git's is not possible from stderr alone.Closes #309
🤖 Generated with Claude Code