Skip to content

Conversation

@khaong
Copy link
Contributor

@khaong khaong commented Feb 10, 2026

Summary

Follow-up to #203 — fixes a regression where entire explain on the default branch (main/master) only showed checkpoints from first-parent commits, missing checkpoint commits that came in via merged feature branches (second parents of merge commits).

  • On the default branch: use repo.Log() full DAG walk (no branch filtering needed), finding checkpoints on all reachable commits including merged feature branches
  • On feature branches: use walkFirstParentCommits with reachableFromMain filtering (unchanged from fix: use first-parent traversal in explain to handle merge commits #203)
  • Extract collectCheckpoint helper to avoid duplicating the checkpoint-to-RewindPoint conversion between the two code paths

Context

The original repo.Log() code worked on both default and feature branches because on the default branch, reachableFromMain was empty so no filtering happened. #203 replaced repo.Log() with walkFirstParentCommits everywhere, which fixed feature branches but broke the default branch by only walking the first-parent chain.

Test plan

  • TestGetBranchCheckpoints_DefaultBranchFindsMergedCheckpoints — creates merge commit on master with checkpoint-tagged feature branch commit as second parent, verifies it's found
  • All existing explain tests pass
  • Integration tests pass with -race

🤖 Generated with Claude Code


Note

Low Risk
Behavior change is limited to how getBranchCheckpoints enumerates commits on the default branch, with added test coverage for the merge-parent case; minimal impact outside entire explain output.

Overview
Fixes a regression in entire explain branch view where, on the default branch, checkpoint commits that arrived via merge commits (i.e., on non-first-parent paths) were not shown.

getBranchCheckpoints now uses a full repo.Log() DAG walk (with a scan limit) when on the default branch, while keeping the existing first-parent traversal plus reachableFromMain filtering on feature branches; the checkpoint-to-RewindPoint conversion is factored into a shared collectCheckpoint helper. Adds a regression test that constructs a real merge commit on master and asserts merged feature-branch checkpoints are discovered.

Written by Cursor Bugbot for commit 5cb78b8. This will update automatically on new commits. Configure here.

On the default branch, checkpoint commits from merged feature branches
live on second parents of merge commits. First-parent-only traversal
misses these entirely. Restore the old repo.Log() full DAG walk for
the default branch case, keeping first-parent walk for feature branches
where it's needed to avoid walking into main's history.

Add TestGetBranchCheckpoints_DefaultBranchFindsMergedCheckpoints to
verify checkpoints from merged feature branches are found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 2c679ac78905
Copilot AI review requested due to automatic review settings February 10, 2026 05:32
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a regression where entire explain on the default branch missed checkpoints introduced via merged feature branches by switching the default-branch scan to a full DAG walk.

Changes:

  • Use repo.Log() (full DAG walk) on the default branch while keeping first-parent traversal + main filtering on feature branches.
  • Extract a collectCheckpoint helper to share checkpoint→RewindPoint construction.
  • Add a regression test covering merged (second-parent) checkpoint discovery on the default branch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cmd/entire/cli/explain.go Restores full DAG traversal on default branch and factors out checkpoint collection logic.
cmd/entire/cli/explain_test.go Adds regression test ensuring merged-branch checkpoints are found on default branch.

khaong and others added 2 commits February 10, 2026 16:42
iter.ForEach propagates callback errors to the caller, unlike
walkFirstParentCommits which handles errStopIteration internally.
Use go-git's storer.ErrStop sentinel which ForEach treats as normal
termination (returns nil).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 684463275ef4
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@khaong khaong marked this pull request as ready for review February 10, 2026 06:20
@khaong khaong requested a review from a team as a code owner February 10, 2026 06:20
@khaong khaong merged commit 36eca89 into main Feb 10, 2026
10 checks passed
@khaong khaong deleted the alex/entire-explain-fixes branch February 10, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants