Say how far behind a fork is, next to Update from parent #3

Closed
trevato wants to merge 0 commits from fork-drift into main
Owner

A fork's About rail says how far its default branch sits from its parent's, beside the Update from parent button, and offers the update only when it would fast-forward. Built by the crew on the forge, reviewed and merged there, proposed here as one change.

🤖 Generated with Claude Code

A fork's About rail says how far its default branch sits from its parent's, beside the Update from parent button, and offers the update only when it would fast-forward. Built by the crew on the forge, reviewed and merged there, proposed here as one change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`forkDrift` answers what `syncFork` would do before anyone presses the
button: `behind` is what an update would bring, `ahead` is what makes one
impossible. It is a read, not a mutation — the parent's objects reach the
fork through its alternates, so one `rev-list --left-right --count`
(`divergence`, already in git/branches.ts) in the fork answers both halves,
and both are null when git cannot answer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Fork-of row now reads "3 commits behind", "up to date", or "1 commit of
its own, 2 behind — merge by hand", and the button appears only when the
update would fast-forward: nothing to take, or commits of the fork's own in
the way, and there is no button to press. The drift is git, so it is read in
`repoHome` and handed to `aboutCard`; the lineage lookup both need is now
`forkParent`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three states through the real page: dan's fork level with alice's, then
behind by one after she moves on with nothing following her, then bob's,
which has a commit of its own and cannot be updated at all.

The fixture's git environment also clears `GIT_CONFIG_COUNT`, for the same
reason it points the global and system config at /dev/null: a crew run hands
git an `http.extraHeader` for its own forge, and that credential would go to
the test server instead of the one in the clone URL.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merge pull request #2 from mason/1-say-how-far-behind-a-fork-is-next-to-upd
Some checks failed
check / check (pull_request) Failing after 6m54s
preview / preview (pull_request) Successful in 8s
6d52ec55da
Say how far behind a fork is, next to Update from parent
Contributor

🔴 check is red at 6d52ec55da (fix round 1/3). Fix it on this branch: run bun run check locally (lint, typecheck, build, tests, design conformance — the same job CI runs), push, and the review resumes when it is green. The head on origin is what gets reviewed.

🔴 `check` is red at `6d52ec55da` (fix round 1/3). Fix it on this branch: run `bun run check` locally (lint, typecheck, build, tests, design conformance — the same job CI runs), push, and the review resumes when it is green. The head on origin is what gets reviewed.
Contributor
🔎 Preview is live for QA: https://pr-3-forge-trevato-apps.open-platform.sh
trevato closed this pull request 2026-10-06 15:15:12 +00:00
Some checks failed
check / check (pull_request) Failing after 6m54s
preview / preview (pull_request) Successful in 8s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
trevato-apps/forge!3
No description provided.