Repository navigation
gardener: clearer pull warnings after #1267 - #1311
Merged
Merged
Conversation
A refused pull's warning in report.md now says why, from git's first error:/fatal: line and the files it lists (an untracked file where the new commit adds one, a left-over index.lock, a skip-worktree edit), not git's closing "Aborting". git's words stay out of the issue. The README no longer says untracked files are always safe: an ignored file at a path the new commit adds is replaced, as plain git pull does (pinned by a test). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
lens: code · reviewer: Claude Opus 5.5 (code lens, round 1) · read at: 2ca778b blocker: none What I checked
State question
🤖 Generated with Claude Code |
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.
Follow-up to #1267, from its round-2 code lens (both minors).
1. A refused pull names why. The
gardener.root-not-pulleddetail in report.md was git's last stderr line, which isAbortingfor most refusals. It is now git's firsterror:/fatal:line plus the file names git lists under it, on one line (at most 5, then "and N more"; last line as before when there is no such line):error: The following untracked working tree files would be overwritten by merge: added.daterror: Unable to create '…/.git/index.lock': File exists.error: Your local changes to the following files would be overwritten by merge: first.txtgit's words still go to the local report and log only. The issue gets the fixed text, and its fixed
fixtext now also lists "an untracked file where a new commit adds one".2. Ignored files: README corrected, not refused. The README now says that git refuses a pull that would overwrite an untracked file, but an ignored file (
.gitignore,.git/info/exclude) at a path the new commit adds is replaced, as a plaingit pulldoes. I did not add a refusal. It would mean splitting the pull into fetch, a path check, andmerge --ff-only @{u}, which reopens the pull path that rounds 1–2 checked (autostash flags, ff-only). It would also leave a warning that a person has to clear every time upstream starts tracking a generated file. A test pins the documented behaviour.Tests (
fork-kit/gardener/tests/run.test.py, classPull). The first three failed before the fix, showing(Aborting)or the lock's "remove the file manually" line:index.lock: named; a--forcererun with the lock still there gives the same one warning; once the lock is removed the next run pulls_git_saidunit test: name cap and the last-line fallback_last_linefails the untracked-clash testRan locally:
checks,installandruntests all pass. Inreport.test.py, 9Judgetests fail here because they serve a fake model on 127.0.0.1, which this machine blocks. They do not touch code this PR changes. CI runs them.State question
--force, runs status and pull from scratch, after the lock and done-day check. It gives the same one warning (now naming the cause) until the cause is gone, then it pulls. The index.lock test covers this.index.lock(for example a pull killed at the 5-minute limit during checkout): the root is not changed. Every run names the lock file until a person removes it; it is never removed automatically. Half-moved files from a killed checkout show up as dirty in the next status, so nothing is pulled over them.pull: unchanged (off).Fixes the two minors from the round-2 code lens on #1267.
🤖 Generated with Claude Code