Say the mirror is unfetched on the screen most users read - #404
Merged
Conversation
`init` printed four ticks and `ready` on a fresh clone whose `refs/notes/commitlore` had never been fetched, and said nothing about it. That is not an edge case: `git fetch` does not carry the ref, which is why the refspec and `doctor --fix` exist at all. So the default path for a new user on an existing repository was to run one command, read `ready`, and hold an index missing every record the team kept in notes. Every other route already says it -- context exits 3, stale reports the scan incomplete, guard exits 3, validate says references not checked, and index says it since #401. This was the last one, and the worst placed. The fix is not where it looks. `init` runs `doctor --fix`, which writes the refspec, and that moves the state from `unfetched` to `absent` before the report is formatted -- so reading `notesAvailability()` at format time always misses the case the user is in. Verified before writing the line: unfetched before init, absent after. The state is captured before any step runs and carried on the report. What that leaves after init is exactly the shape r-fetchowed named one command over: the configuration is now right and the records are still missing. The sentence exists in doctor's output already, under --verbose only. No contract was changed to fit it. The clean run was five non-empty lines against the six T-1012 allows, so the line fits in the spare one, and a test pins that it still does. `ready` stays and the exit code stays 0 -- an unfetched mirror is not an init failure, which is what #401 settled for index. Record-Id: r-initunfetched Limit: it reports the state as it was before init ran, so a mirror fetched between the capture and the report would be named wrongly; that window is the four steps of one command Ruled-out: Reading notesAvailability at format time | init's own doctor step writes the refspec first, so the read always returns absent and the line never appears -- measured, not assumed Ruled-out: Widening the six-line contract | it was not needed, and a contract loosened to fit one line is loosened for every line after it Ruled-out: Making init exit non-zero | #401 settled that an unfetched mirror is not a failure of the command that built the index over it Certainty: firm Blast: local Undo: easy Verified: reproduced in a fresh clone -- ready with no mention before, the note line after; state confirmed unfetched before init and absent after, which is why the capture moved; four tests pin the line, the six-line limit with it present, silence on present/absent/unavailable, and that ready survives; reverting the source leaves exactly the one test that pins the new behaviour failing; init, init-output, doctor and cli pass at 97; typecheck clean; bench:verify unchanged Unverified: whether backfill's target selection has the same blind spot, which is #403 and is not touched here
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (85)
Ruled out (198)
Warnings (45)
Truncated: 11 lines omitted — the comment hit GitHub's 65000 character limit. Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
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.
Closes #402. Split out of #401, which fixed the same defect in
index.initprinted four ticks andreadyon a fresh clone whoserefs/notes/commitlorehad never been fetched, and said nothing about it. That is not an edge case —git fetchdoes not carry the ref, which is why the refspec anddoctor --fixexist. The default path for a new user on an existing repository was: run one command, readready, hold an index missing every record the team kept in notes.Every other route already says it —
contextexits 3,stalereports the scan incomplete,guardexits 3,validatesaysreferences not checked,indexsays it since #401. This was the last, and the worst placed.The fix is not where it looks
initrunsdoctor --fix, which writes the refspec — moving the state fromunfetchedtoabsentbefore the report is formatted. ReadingnotesAvailability()at format time therefore always misses the case the user is in. Measured, not assumed:So the state is captured before any step runs and carried on the report.
What that leaves after
initis exactly the shaper-fetchowednamed one command over: the configuration is now right and the records are still missing.No contract was changed to fit it
The clean run was 5 non-empty lines against the 6 T-1012 allows. The line fits in the spare one, and a test pins that it still does.
readystays; exit code stays 0 — #401 settled that an unfetched mirror is not a failure of the command that built the index over it.Verified
readywith no mention before; the note line afterpresent/absent/unavailable, and thatreadysurvivesinit,init-output,doctor,clitypecheck,bench:verifyStated limit: it reports the state as it stood before
initran, so a mirror fetched between the capture and the report would be named wrongly. That window is the four steps of one command.