git worktree add emits 'fatal: bad object 000000...' via branchless hook

t-576·WorkTask·
·
·
·Omni/Ide.hs
Created1 week ago·Updated1 week ago

Dependencies

Description

Edit

While testing Omni/Ide/dev-review-release.sh setup-worktrees, each 'git worktree add' succeeded but printed: 'fatal: bad object 0000000000000000000000000000000000000000' followed by 'branchless: processing checkout'. This appears to come from git-branchless hook processing and may indicate a hook bug/noisy false error path.

Timeline (33)

💬[human]1 week ago

Reproduced again during setup-worktrees smoke tests (2026-02-10). worktree creation succeeds, but branchless hook prints 'fatal: bad object 0000000000000000000000000000000000000000' on each checkout.

🔄[human]Open → InProgress1 week ago
💬[human]1 week ago

Implemented hook-level fix in commit b690a655. Root cause was zero-OID transitions during worktree creation triggering in post-checkout and noisy branchless hook processing. Added guards in post-checkout and reference-transaction hooks for zero/non-commit inputs and linked-worktree branchless skip. Repro now clean: setup-worktrees on _/tmp/t576-repro4 shows no 'fatal: bad object 000...' lines.

🔄[human]InProgress → Review1 week ago
🔄[system]Review → ReviewInProgress1 week ago
🔄[human]ReviewInProgress → Review1 week ago
🔄[system]Review → ReviewInProgress1 week ago
🔄[human]ReviewInProgress → Review1 week ago
🔄[system]Review → ReviewInProgress1 week ago
🔄[human]ReviewInProgress → Review1 week ago
🔄[system]Review → ReviewInProgress1 week ago
💬[human]1 week ago

Review of patchset 1:

reference-transaction hook (CRITICAL): The zero-OID filter in reference-transaction is too broad. It skips branchless processing for ALL transactions containing zero OIDs, which includes every normal branch creation (git branch foo, old=0000...) and deletion (git branch -d foo, new=0000...). This means branchless will lose track of branch create/delete events outside of worktree operations, silently degrading its internal DAG/smartlog over time.

Fix suggestion for reference-transaction: Either: (a) Only apply the zero-OID skip when in a linked worktree context (check git-dir like the post-checkout hook does), or (b) Redirect stderr from the branchless call to /dev/null instead of skipping entirely (suppresses the noise while preserving event tracking), or (c) Filter the zero-OID lines from stdin but still pass remaining lines to branchless.

post-checkout hook (OK with note): The linked-worktree guard that skips branchless in all linked worktrees is broader than strictly needed (it skips even normal checkouts within worktrees, not just creation), but this is acceptable for the current workflow where worktrees are task-specific and stay on their branch.

🔄[human]ReviewInProgress → Open1 week ago
💬[human]1 week ago

Automation (review) run review-t-576-20260211-223040 cost_cents=0 cumulative_cost_cents=0.

💬[human]1 week ago

Addressed review feedback in commit d16904b5: reverted broad reference-transaction suppression; fix is now scoped to post-checkout hook only (skip zero-OID diff/tag path and skip branchless post-checkout in linked worktrees). Reproduced setup-worktrees on _/tmp/t576-repro5 with no fatal bad-object noise.

🔄[human]Open → Review1 week ago
🔄[system]Review → ReviewInProgress1 week ago
💬[human]1 week ago
🔄[human]ReviewInProgress → Approved1 week ago
💬[human]1 week ago

Automation (review) run review-t-576-20260211-223434 cost_cents=0 cumulative_cost_cents=0.

🔄[system]Approved → Integrating1 week ago
💬[human]1 week ago

Integrated into live as commit 26c66ca28a1f3581a765adebe1c0d79dd3512e3e. Build verification skipped (bild unavailable in container environment). Bash syntax validated successfully.

🔄[human]Integrating → Done1 week ago
💬[human]1 week ago

Automation (integrator) run integrator-t-576-20260211-223738 cost_cents=0 cumulative_cost_cents=0.