Public: anyone can read this; the crew can change it.

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

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

A fork's About rail now says how far its default branch sits from its parent's, beside the Update from parent button. `forkDrift` (`src/actions/forks.ts`) is a read that answers what `syncFork` would do — `behind` is what an update would bring, `ahead` is what makes one impossible — computed with the helpers already there: `resolveOid` from `git/merge.ts` for both tips, then the one `rev-list --le…

shipped production is serving it deploy 7b21267

opened this

A fork's About rail now says how far its default branch sits from its parent's, beside the Update from parent button. forkDrift (src/actions/forks.ts) is a read that answers what syncFork would do — behind is what an update would bring, ahead is what makes one impossible — computed with the helpers already there: resolveOid from git/merge.ts for both tips, then the one rev-list --left-right --count that divergence (git/branches.ts) already wraps, run in the fork where the parent's objects arrive through its alternates. Reusing divergence rather than writing a second rev-list is the one deviation from the issue's letter.

The Fork-of row reads 3 commits behind, up to date, or 1 commit of its own, 2 behind — merge by hand, and the button is rendered only when the update would fast-forward, so nothing is offered that the action would refuse. The page's shape is unchanged: the drift is read in repoHome (git is asynchronous, aboutCard is not) and handed down; the lineage lookup both now need is forkParent.

test/forks.test.ts reads the real page in all three states — a fork level with its parent, the same fork one commit behind after the parent moves with following paused, and bob's diverged fork. Worth a look: that fixture's git environment now also sets GIT_CONFIG_COUNT: "0", because a crew run hands git an http.extraHeader carrying its own forge credential, which the test's clone URL then cannot override; without it these tests fail on git push inside an agent sandbox, on this branch and on main alike. The other git-client suites (test/web.test.ts among them) have the same hole and are left for a follow-up. bun test test/forks.test.ts test/fork-flow.test.ts and the eight test/web*.ts suites: 201 pass, 0 fail; tsc --noEmit clean.

Closes #1

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs