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

Detaching a fork keeps objects its own forks still borrow (repack --keep-unreachable) #16892

Merged opened this

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

Merged

Two scout/forge branches point at commits that no longer exist (the status page's backup fault). Cause, read-only: the fork borrows trevato/forge's objects through alternates; its loose copies went once the parent packed them, and the parent later pruned them because its gc couldn't see the fork's refs.

Notes

opened this

Two scout/forge branches point at commits that no longer exist (the status page's backup fault). Cause, read-only: the fork borrows trevato/forge's objects through alternates; its loose copies went once the parent packed them, and the parent later pruned them because its gc couldn't see the fork's refs. #12589 (11-14, keepLentObjects, src/git/repos.ts ~110) fixed that by setting gc.pruneExpire=never on every lender (all 64 lenders on production have it), so those two refs are leftovers from before it, not a new loss.

Remaining hole: detachFork (src/git/repos.ts ~172) runs a plain repack -a -d, which ignores pruneExpire. Fork chains exist on production (cs-engine and effect-template both borrow and lend), so detaching a middle fork can strand its own fork's branches the same way.

  • detachFork repacks with --keep-unreachable.
  • Test: a parent ← middle ← child chain; detaching the middle keeps the child's branches readable. Fails on main, passes with the fix.

The two stranded refs can only come back from a backup taken before mid-October, or be deleted (the owner's call).

tsc and gate clean.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs