fix(worktrees): per-row last-commit reads the row's own HEAD, not the family's newest#42
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.)Repo::log_head(limit)walks HEAD's ancestry only;logandlog_headshare a privaterun_logrunner, the ref selectors being the only difference (unborn-HEAD → empty mapping and parsing unchanged).head_onlyflag on therepo_logIPC /repoLog(path, limit, headOnly)wrapper — existing callers unchanged;Worktrees.tsxpassestruefor its per-row fetch.Test plan
cargo test -p strand-core— 13 log/reflog tests pass, including 2 new: a newer side-branch tip is excluded fromlog_head; an unborn HEAD yields empty likelog.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