Skip to content

fix(list): keep other rows' commit details when one worktree's HEAD object is missing - #4852

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-4851
Nov 21, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-4851

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

git log --no-walk refuses the whole call when one SHA names an absent object, so a single worktree whose HEAD points nowhere blanked Commit, Age and Message on every wt list row. commit_details_many now passes --ignore-missing, which keeps the single batch and simply omits the unreadable SHA; wt list then warns once per requested SHA git didn't return (▲ Commit 1234…7890 not found in repository; its rows show no commit details), so the explanation stays and only the broken row loses its cells. With the issue's reproduction, main and healthy now show first with their SHA and age.

In schema-2 JSON, head.short_sha is null when it wasn't determined, like subject and committed_at beside it, rather than "". The help table and generated schema/docs reflect that. Schema 1 is unchanged.

Tests:

  • test_list_missing_head_object_keeps_other_rows_details reproduces the report in JSON: it fails on the old code with the batch-failure warning and passes now, with healthy rows carrying short_sha/subject and the broken row null.
  • The unit test commit_details_many_fails_loudly_on_unknown_sha pinned the old all-or-nothing behavior; it is replaced by commit_details_many_omits_missing_objects (a readable SHA, an absent one, and the null OID return just the readable commit).
  • The old snapshot test for the batch failure now exercises the per-SHA path, so it is renamed test_list_warns_when_head_commit_missing; its snapshot, and list_shows_warning_on_git_error's, now show the healthy rows' details.
  • --ignore-missing doesn't skip a corrupt loose object — git still exits 128 — so the batch-failure warning remains reachable. A new test_list_warns_when_commit_details_batch_fails covers it by corrupting a commit only a detached worktree reaches.

The null-OID filter before the batch stays: git would accept the null OID under --ignore-missing, but the filter is what keeps unborn branches out of the new missing-commit warning.

Closes #4851 — automated triage

…ssing

`commit_details_many` fetched every row's details with one
`git log --no-walk` call, which git refuses outright when any SHA names an
absent object, so a single worktree whose HEAD points nowhere blanked the
Commit, Age and Message of every row. The batch now passes
`--ignore-missing`, and `wt list` warns once per requested SHA git didn't
return, so only the broken row goes without details. A corrupt (present but
unreadable) object still fails the batch and keeps the existing warning.

Schema-2 JSON `head.short_sha` is now null when undetermined, matching
`subject` and `committed_at`, instead of "".

Closes #4851
@worktrunk-bot worktrunk-bot added the automated-fix Automated CI fix label Nov 20, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-coverage fails on integration_tests::help::test_help::case_07: the short_sha row in the head object table changed, and help_list_narrow_80.snap was refreshed for it, but help_list_long.snap still shows the old string type and description. The fix is to regenerate that snapshot, and I'm pushing it now.

@max-sixty
max-sixty merged commit a55b8a7 into main Nov 21, 2026
44 of 45 checks passed
@max-sixty
max-sixty deleted the fix/issue-4851 branch November 21, 2026 00:55
max-sixty pushed a commit that referenced this pull request Nov 25, 2026
…ed mirror fails in 5 min (#4917)

Every remaining `apt-get` call in CI now runs under the same `sudo
timeout -k 30 300` bound that `tend-setup` has used since #3855. That
covers `test-setup`, `coverage.yaml`, `benchmarks.yaml` and the three
`nightly.yaml` steps. A wedged Ubuntu mirror now fails the step after
five minutes, where a rerun fixes it. Today it holds the job until
GitHub kills it at the 360-minute cap, along with every tend session
polling that PR. This PR's own `test (linux)` and `affected tests
(linux)` jobs exercise the new `test-setup` step.

#3855 left these sites unbounded because none had hung yet, and offered
to widen the bound if one did. Three hangs have hit them since:

| when | job | outcome |
|---|---|---|
| 2026-10-07 | six x86_64 Linux jobs across nightly and PR runs (#4396)
| all killed at the 360-min cap |
| 2026-11-20 | `test (linux)` on #4852 | stuck 4.5 h, until a
review-runs sweep cancelled it; one triage and two review sessions
polled it the whole time |
| 2026-11-24 | `affected tests (linux, advisory)` on #4910
([job](https://github.com/max-sixty/worktrunk/actions/runs/45343341632/attempts/1))
| killed at the cap; nightly
[45340530290](https://github.com/max-sixty/worktrunk/actions/runs/45340530290)
and review
[45343341664](https://github.com/max-sixty/worktrunk/actions/runs/45343341664)
each sat ~340 min in `poll-pr-checks` and ended unverified |

Each log ends mid-`apt-get update` (after `Get:5 … noble-security
InRelease` on 11-24), followed by hours of silence and then
`##[error]The operation was canceled.` Observations are tracked in
#4657.

<details><summary>Why <code>timeout(1)</code> and not step-level
<code>timeout-minutes</code></summary>

`test-setup` is a composite action, and composite steps don't accept
`timeout-minutes`. That's why `tend-setup` uses `timeout(1)`, and its
comment explains the `-k 30` escalation. Using the same form at the
workflow-file sites keeps a single pattern. A healthy update takes about
15 s, so five minutes is headroom. Both expiry codes (124 on SIGTERM,
137 after the kill) fail the step.

</details>

Co-authored-by: worktrunk-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated CI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wt list loses every row's commit details when one worktree's HEAD object is missing

2 participants