Skip to content

fix: only track commits from when branch diverges#126

Merged
matt2e merged 1 commit intomainfrom
matt2e/rebase
Feb 14, 2026
Merged

fix: only track commits from when branch diverges#126
matt2e merged 1 commit intomainfrom
matt2e/rebase

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Feb 14, 2026

No description provided.

After a rebase or when the base ref (e.g. origin/main) has advanced,
using a raw `base..HEAD` range for git log includes commits that
belong to the parent branch rather than just the branch's own commits.

Replace all three call sites that computed commit ranges with
merge-base lookups to find the actual fork point:

- get_commits_since_base() in git/worktree.rs (local branch timeline)
- get_full_commit_log() in git/worktree.rs (local branch context)
- get_branch_timeline() in lib.rs (remote branch timeline via ws_exec)
- build_remote_branch_context() in session_commands.rs (remote context)

This is consistent with how build_diff_spec already uses
GitRef::MergeBaseOf for computing diffs. The remote branch paths
fall back to the raw range if merge-base fails (e.g. shallow clone).
@matt2e matt2e changed the title feat: UI redesign, data migration, and reliability improvements fix: only track commits from when branch diverges Feb 14, 2026
@matt2e matt2e merged commit 1d1e104 into main Feb 14, 2026
3 checks passed
@matt2e matt2e deleted the matt2e/rebase branch February 14, 2026 00:55
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