fix(git-log): default commits to current worktree branch - #838
Merged
xintaofei merged 5 commits intoSep 28, 2026
Merged
Conversation
dawNotPoi
marked this pull request as ready for review
September 25, 2026 05:39
Contributor
Author
|
@xintaofei PR #838 is ready for review. For #620, a fresh Commits tab now queries this worktree’s |
dawNotPoi
force-pushed
the
fix/commits-default-current-620
branch
from
September 28, 2026 07:02
67f77b3 to
df93789
Compare
The old writer stored an author picked on the then-default all-branches
view as {"branch":null,"author":…} and deleted a null/null entry, so an
unversioned null branch was never a choice. Reading it as an explicit
All branches kept exactly the users with an author filter on git log
--all while everyone else got the HEAD default.
Saved selections now carry a version; only a versioned null means an
explicit All branches choice, and an unversioned one opens on HEAD like
a folder with no entry.
A branch refresh answered while the live active folder differed from the deferred one was dropped. When the active folder goes A→B→A before the deferred render ever commits B, the deferred folder never leaves A, so refreshBranches keeps its identity and nothing asks for A's branches again: the header lost its branch and author pills and reset stayed disabled until the next git event, and a manual refresh did not help. The metadata is tagged with its path and hidden until the view catches up, and the sequence and deferred-path checks already drop superseded or other-folder responses, so the refresh no longer consults the live active folder.
"New branch..." runs `git checkout -b <name> <commit>`, which moves HEAD. The handler only refreshed branch metadata, on the grounds that the all-branches commit set is unchanged — true for the old default, not for the HEAD view that is now the default: the pill named the new branch while the list kept the previous branch's commits until the 10 s HEAD poll noticed. The HEAD view now reloads inline. The reload is issued before the branch refresh is awaited, while the modal dialog has kept the filter unchanged, so a filter picked once the dialog closes is not overwritten by a reload built from the old one.
Owner
|
codeg work task |
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
HEADfilter, so the first log query follows the active checkout instead of runninggit log --all.HEADdefault.HEADwhen a saved named branch is deleted. Ignore stale branch refresh responses and hide old branch metadata while switching worktrees.Result
On a fresh Commits tab, the first
gitLogrequest usesbranch=HEADandallBranches=false. Selecting All Branches usesallBranches=trueand remains selected after remount. Delayed branch responses cannot replace a newer selection or show the previous worktree's branch.Verification
pnpm exec tsc --noEmitpnpm lint .git diff 2774a7e..HEAD --checkThis addresses the Commits filtering described in #620. Detecting worktrees modified by an agent and merging the Git tabs remain separate concerns, as discussed in the issue.
Closes #620