Repository navigation
fork-follow: fetch the rebase's files first, name every stop (#475) - #496
Conversation
204e918 to
db683d8
Compare
|
lens: trust verdict: SAFE (head db683d8) Read-only review (trust/safety lens). The change cannot make fork-follow release something wrong: Checked
Minor 1: upstream file names can break out of the "What git said" fence (markdown and live @mention in the issue) ( Impact is low: upstream already ships code to every install, the fork's release is unaffected, and the plan still fails closed. Fix: indent each quoted line by four spaces instead of fencing it ( Minor 2: the #475 path itself ( Nits |
|
lens: state verdict: SAFE (head db683d8) read at: db683d8 (the head did not move during the review) Lens: state. This was a read-only review: nothing was pushed, and no branch, tag, release or workflow was touched. My clone and containers are deleted. I ran everything on Git 2.43.0 (the host) and Git 2.56.1 (alpine:edge in docker). In short: the prefetch is complete for the real #475 case. On Git 2.56.1, with origin refusing any fetch while the rebase runs, the PR's script follows with no fetch reaching origin. The old script stops with "stopped at: unknown". Every exit path of the rebase step that I could reach names a patch or the start, and quotes git. I found no blocker and no major. There are two minors, two nits and two infos. Evidence
State answers
Findings
|
The Plan job checks out with --filter=blob:none, so the rebase fetched each
missing file from origin on first read. Git 2.56 (ubuntu-26.04 runners) asked,
while applying a pick, for the blob that pick had just merged; origin has no
such object ("not our ref"), so the pick died with a git error. There was no
REBASE_HEAD and no unmerged file, so the report said "stopped at: unknown"
with no reason.
- Before the rebase, fetch in one batch every blob it reads that is missing
here (each patch's sides, the series' own, the old base's side of upstream's
changes). The promisor is extensions.partialclone or the remote marked
promisor = true. The rebase then never fetches.
- A stop names the patch from REBASE_HEAD, else the last pick in the done
list, else says git did not begin; it says whether it was a conflict or a
git error and quotes git's own output (last 20 lines, no progress lines).
Tests (red on the old script, green now): a partial clone whose origin refuses
fetches while a rebase runs follows; a pick stopped by a git error names the
patch and quotes git; a rebase git refuses to begin says so; a conflict report
quotes git.
Refs #475
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check that the partial clone lacks a blob piped rev-list into grep -q, which fork-ci-tests.test.cjs refuses (SIGPIPE under pipefail). grep -c reads everything. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…op (#475) - Git's words, the conflict list and upstream file names go into the report as indented code blocks that no line can end, and every @ in a report gets a zero-width space, so no name mentions anyone. - The prefetch also asks for the target side of upstream's changes: a server with reachability bitmaps does not send a blob the base's history already has (an upstream revert), and the checkout read it. - A promisor remote marked yes/on/1 is found (git config --type=bool). - A stop before the first pick, and a --continue/--skip that fails and ends the rebase, are named as such; a failed rebase --abort is quoted. - Tests: fence in a file name, @ file, failed abort, continue ending the rebase, refused prefetch, mid-pick die (done list), die at checkout, revert prefetch, promisor spellings. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
db683d8 to
089e2d2
Compare
…496) * fork-follow: fetch the rebase's files first, name every stop (#475) The Plan job checks out with --filter=blob:none, so the rebase fetched each missing file from origin on first read. Git 2.56 (ubuntu-26.04 runners) asked, while applying a pick, for the blob that pick had just merged; origin has no such object ("not our ref"), so the pick died with a git error. There was no REBASE_HEAD and no unmerged file, so the report said "stopped at: unknown" with no reason. - Before the rebase, fetch in one batch every blob it reads that is missing here (each patch's sides, the series' own, the old base's side of upstream's changes). The promisor is extensions.partialclone or the remote marked promisor = true. The rebase then never fetches. - A stop names the patch from REBASE_HEAD, else the last pick in the done list, else says git did not begin; it says whether it was a conflict or a git error and quotes git's own output (last 20 lines, no progress lines). Tests (red on the old script, green now): a partial clone whose origin refuses fetches while a rebase runs follows; a pick stopped by a git error names the patch and quotes git; a rebase git refuses to begin says so; a conflict report quotes git. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fork-follow test: read the whole rev-list, not grep -q (lint) The check that the partial clone lacks a blob piped rev-list into grep -q, which fork-ci-tests.test.cjs refuses (SIGPIPE under pipefail). grep -c reads everything. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fork-follow: quote git safely, prefetch reverted blobs, name every stop (#475) - Git's words, the conflict list and upstream file names go into the report as indented code blocks that no line can end, and every @ in a report gets a zero-width space, so no name mentions anyone. - The prefetch also asks for the target side of upstream's changes: a server with reachability bitmaps does not send a blob the base's history already has (an upstream revert), and the checkout read it. - A promisor remote marked yes/on/1 is found (git config --type=bool). - A stop before the first pick, and a --continue/--skip that fails and ends the rebase, are named as such; a failed rebase --abort is quoted. - Tests: fence in a file name, @ file, failed abort, continue ending the rebase, refused prefetch, mid-pick die (done list), die at checkout, revert prefetch, promisor spellings. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: t <t@t>
…496) * fork-follow: fetch the rebase's files first, name every stop (#475) The Plan job checks out with --filter=blob:none, so the rebase fetched each missing file from origin on first read. Git 2.56 (ubuntu-26.04 runners) asked, while applying a pick, for the blob that pick had just merged; origin has no such object ("not our ref"), so the pick died with a git error. There was no REBASE_HEAD and no unmerged file, so the report said "stopped at: unknown" with no reason. - Before the rebase, fetch in one batch every blob it reads that is missing here (each patch's sides, the series' own, the old base's side of upstream's changes). The promisor is extensions.partialclone or the remote marked promisor = true. The rebase then never fetches. - A stop names the patch from REBASE_HEAD, else the last pick in the done list, else says git did not begin; it says whether it was a conflict or a git error and quotes git's own output (last 20 lines, no progress lines). Tests (red on the old script, green now): a partial clone whose origin refuses fetches while a rebase runs follows; a pick stopped by a git error names the patch and quotes git; a rebase git refuses to begin says so; a conflict report quotes git. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fork-follow test: read the whole rev-list, not grep -q (lint) The check that the partial clone lacks a blob piped rev-list into grep -q, which fork-ci-tests.test.cjs refuses (SIGPIPE under pipefail). grep -c reads everything. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fork-follow: quote git safely, prefetch reverted blobs, name every stop (#475) - Git's words, the conflict list and upstream file names go into the report as indented code blocks that no line can end, and every @ in a report gets a zero-width space, so no name mentions anyone. - The prefetch also asks for the target side of upstream's changes: a server with reachability bitmaps does not send a blob the base's history already has (an upstream revert), and the checkout read it. - A promisor remote marked yes/on/1 is found (git config --type=bool). - A stop before the first pick, and a --continue/--skip that fails and ends the rebase, are named as such; a failed rebase --abort is quoted. - Tests: fence in a file name, @ file, failed abort, continue ending the rebase, refused prefetch, mid-pick die (done list), die at checkout, revert prefetch, promisor spellings. Refs #475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: t <t@t>
Refs #475
Root cause
The Plan job checks out with
--filter=blob:none(a partial clone), so during the rebase git fetches each missing file from origin the first time it reads it. The runners moved to ubuntu-26.04 with Git 2.56.1. While applying pick 28/232, Git 2.56.1 asked origin, in one batch, for the blob that this pick had itself just merged (apps/server/src/cloud/selfUpdate.ts). No server has that object, so origin answerednot our refand the pick died withfatal: could not fetch … from promisor remote. That is a git error, not a conflict: there is noREBASE_HEADand no unmerged file. The old report took the patch name only fromREBASE_HEAD(|| echo unknown) and never quoted git's output, so it said "stopped at: unknown" with no files and no reason. Git 2.43 does not ask for the merged blob, so the same rebase passes locally.I reproduced this with Git 2.56.1 (alpine:edge) on a
git init+fetch --filter=blob:nonecheckout, as in the workflow, and read the packet trace. With this branch's script on the same setup, the plan follows on its own:action=rebase, the old main → 4877, the same tree as a full-clone rebase, and 1110 blobs fetched in one batch before the rebase.Changes (
.github/scripts/fork-follow.sh)extensions.partialclone, or the remote markedpromisor = true), the script now fetches in one batch every blob the rebase reads that is not already here: both sides of each patch, the series' own objects, and the old base's side of every file upstream changed. The rebase then never needs a lazy fetch. Only ids origin can have are asked for (no gitlinks, no merge results). If that fetch fails, the plan stops before rebasing and quotes git.REBASE_HEAD, else from the last pick inrebase-merge/done, else the report says git did not begin the rebase. The report says whether it was a conflict (and lists the files) or a git error, and always quotes git's own output: the last 20 lines of the last rebase command, without progress lines. "stopped at: unknown" with no reason can no longer be produced.Tests (
.github/scripts/fork-follow.test.sh)The 4 new checks fail on the old script (run with
FORK_FOLLOW_DIRset to main's scripts) and pass now. Totals: 163 ok here; on the old script, 159 ok and 4 FAIL.CONFLICT (lines.^- .github/workflows/ci.yml), because git's quoted output now legitimately names that file.fork-contracts.test.pyandfork-temp-files.test.shalso pass.Fix round (after the trust and state lenses)
Rebased onto main (after #497). Each item has a check that fails on the previous head (
db683d82); withFORK_FOLLOW_DIRset to that head's scripts, 11 checks fail (10 new, plus the narrowed listed-file assertion, whose list is now indented).@in a report gets a zero-width space after it, so no name mentions anyone. Checks: the trust lens's repro (a file name with a newline and a fence line) and a conflicting file named@octo.txt.rebase-merge/done. This check passes on the old head too, since the fallback was already there; withpicked=""it is the one check that fails.donelist, the report says git stopped while it checked out the target, before it applied any patch.git config --type=bool, so a remote markedyes,onor1is prefetched for (one check each).git rebase --abortis quoted in the report and says the checkout is still rebasing.--continue/--skip. When that step fails and git leaves no rebase state, the report names the patch whose listed files were deleted and the command that failed, not "git did not begin the rebase".Found while writing check 4: the prefetch asked only for the base side of upstream's changes, on the assumption that the upstream fetch sends every target blob. A server with reachability bitmaps (GitHub) does not send a blob that the base's history already has, for example when upstream reverts a file to an earlier content. The checkout of the target then fetched it while the rebase ran. The prefetch now asks for both sides; whatever is missing after the upstream fetch is in the base's history, which origin has. Check: a revert with a bitmapped upstream follows with no fetch during the rebase (it fails on the old head).
Not done: each prefetch source is still not pinned on its own (nit 3).
Totals:
fork-follow.test.sh174 ok (was 163).fork-temp-files.test.shandfork-contracts.test.pypass.General vs project
General: prefetching a partial clone's rebase inputs and naming any git stop with git's own words are generic git-follow mechanics. Nothing in them depends on this repository. Project: none. The script still reads its repo, upstream and branch from the workflow's existing env, as before.
🤖 Generated with Claude Code