Skip to content

fix(worktrees): per-row last-commit reads the row's own HEAD, not the family's newest#42

Merged
danielss-dev merged 1 commit into
mainfrom
fix/worktree-last-commit
Jul 7, 2026
Merged

fix(worktrees): per-row last-commit reads the row's own HEAD, not the family's newest#42
danielss-dev merged 1 commit into
mainfrom
fix/worktree-last-commit

Conversation

@danielss-dev

Copy link
Copy Markdown
Owner

Summary

  • The worktree overview's "last commit" line showed the family's newest commit on every row: the stats fetch used repoLog(path, 1), whose ref selectors (HEAD --branches --remotes --tags) are shared by all worktrees — so one worktree committing repainted every row with the same subject. (Surfaced in the 2026-07-08 CDP pass, tracked in TASKS.)
  • New Repo::log_head(limit) walks HEAD's ancestry only; log and log_head share a private run_log runner, the ref selectors being the only difference (unborn-HEAD → empty mapping and parsing unchanged).
  • Exposed as an optional head_only flag on the repo_log IPC / repoLog(path, limit, headOnly) wrapper — existing callers unchanged; Worktrees.tsx passes true for its per-row fetch.
  • TASKS.md item marked done with the changelog note.

Test plan

  • cargo test -p strand-core — 13 log/reflog tests pass, including 2 new: a newer side-branch tip is excluded from log_head; an unborn HEAD yields empty like log.
  • cargo clippy -p strand-core -p strand-tauri — clean.
  • pnpm --filter ./ui exec tsc --noEmit — clean.
  • pnpm --filter ./ui exec vite build — succeeds.

🤖 Generated with Claude Code

… family's newest

The overview's stats fetch used repoLog(path, 1), which walks HEAD plus
every branch/remote/tag - refs all worktrees share - so each row showed
the newest commit anywhere in the family the moment one worktree
committed. Repo::log_head walks HEAD's ancestry only (log and log_head
share a run_log runner), surfaced as an optional head_only flag on
repo_log / repoLog(path, limit, headOnly); the overview passes it.

+2 engine tests: a newer side-branch tip is excluded from log_head, and
an unborn HEAD maps to empty like log.
@danielss-dev danielss-dev merged commit 8e30d61 into main Jul 7, 2026
2 checks passed
@danielss-dev danielss-dev deleted the fix/worktree-last-commit branch July 7, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant