Walk full DAG in entire checkpoint list and accept a git-style revrange#1117
Walk full DAG in entire checkpoint list and accept a git-style revrange#1117
entire checkpoint list and accept a git-style revrange#1117Conversation
`entire checkpoint list` now mirrors `git log` semantics on every branch: the walk follows merge parents so checkpoints on merged feature branches are visible from main, and it no longer stops at commits reachable from main when on a feature branch. Shadow branch reachability reuses the hash set built during the commit walk instead of doing a second pass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Entire-Checkpoint: 3a867c1bcd46
`entire checkpoint list [<revrange>]` accepts git-style ranges: A..B, A.. (= A..HEAD), ..B / B (full from B), and bare HEAD when omitted. Symmetric-difference (A...B) is rejected with a hint. The walk worker is now getBranchCheckpointsInRange, taking a checkpointWalkRange. The right side seeds the DAG walk; the left side builds an exclude set (capped at commitScanLimit) that filters both committed checkpoints and shadow-branch reachability. The existing getBranchCheckpoints is kept as a HEAD-only convenience wrapper for callers and tests that don't need a range. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Entire-Checkpoint: 5c53998d0f97
The default search now walks the full DAG from HEAD bounded by
commitScanLimit, so checkpoints on merged feature branches show up
without --search-all. If the cap is reached without a match, it
auto-falls back to an uncapped walk and writes a one-line note to errW
("Searching full history (no match in last N commits)…"). --search-all
still skips the bounded pass for callers who know the target is older
than the cap.
Drops the now-unused first-parent helpers (computeReachableFromMain,
walkFirstParentCommits, errStopIteration) and their direct test.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Entire-Checkpoint: 4a2d3457aa5d
Covers the empty/HEAD default, single-ref / single-hash resolution, A..B / A.. / ..B shortcuts, and the rejected-input paths (symmetric-difference, unknown ref, unknown left side). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Entire-Checkpoint: ca62da6e74fa
There was a problem hiding this comment.
Pull request overview
This PR updates the checkpoint listing and checkpoint-to-commit association logic to match git log-style full-DAG reachability by default, and adds support for scoping entire checkpoint list to a git-style revision range (rejecting A...B with a hint). It also removes now-obsolete first-parent/default-branch filtering helpers.
Changes:
entire checkpoint listnow walks the full DAG fromHEADby default and accepts a positional revision range (A..B,A..,..B,<ref>).entire checkpoint explain <id>’s associated-commit lookup now uses a bounded full-DAG scan with an automatic fallback to an unbounded scan when the cap is hit with zero matches.- Tests updated for the new associated-commit behavior; parsing tests added for revision ranges.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/entire/cli/explain.go | Implements full-DAG walks for list/explain commit association, adds revision-range parsing + range-based checkpoint scanning. |
| cmd/entire/cli/explain_test.go | Updates associated-commit tests for new semantics; adds tests for fallback scan and revision-range parsing. |
| cmd/entire/cli/checkpoint_group.go | Extends checkpoint list command to accept an optional revision-range argument and updates help text. |
There was a problem hiding this comment.
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.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f0f2fdb. Configure here.
Three fixes from Copilot + Cursor Bugbot: * `buildReachableSet` docstring now matches the implementation: describes the empty-map return for the zero hash and the partial-set best-effort behavior on iteration errors, instead of the earlier "returns nil / errors only on context cancellation" claim. * `getBranchCheckpointsInRange` no longer counts excluded commits toward `commitScanLimit`. Without this, a long left-side history in a range like `main..HEAD` (a feature branch that merged main) would consume the 500-commit cap before the walk reached older feature checkpoints. The exclude-set lookup now runs before the count++. * Adds two end-to-end tests that exercise the range-filtered walk: one that asserts `A..B` semantics on a linear chain (full / left matches no checkpoint / left excludes B / single-side reach), and one regression test that puts the trailered commit past commitScanLimit excluded ancestors so the budget bug shows up if the count++ ever moves before the exclude check again. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Entire-Checkpoint: afba672398df
- Tighten the in-walk comment in getBranchCheckpointsInRange to lead with the why (`main..HEAD` budget starvation) instead of restating what the reordered code already shows. - Drop em-dashes from table-driven test names so `-run` patterns are shell-friendly, and drop a redundant `wantNotContains: nil` line. - Uncap buildReachableSet so a left-side history longer than commitScanLimit doesn't silently leak older commits past the exclude. Hashes are 20 bytes, so even 100k commits cost ~2MB. - Rebuild the budget regression test on createCommitWithTree instead of worktree commits — same coverage, ~3x faster (0.79s → 0.24s). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Entire-Checkpoint: 3a65001cf1d8

https://entire.io/gh/entireio/cli/trails/299
entire checkpoint listnow mirrorsgit logsemantics on every branch — checkpoints on merged feature branches are visible from main, and on a feature branch we no longer stop at commits reachable from main. To opt back into the old "feature-only" view (or scope to any other range), pass a positional revrange:A..B,A..(=A..HEAD),..B/B(full from B). Symmetric-difference (A...B) is rejected with a hint.Same shift for
entire checkpoint explain <id>'s associated-commits scan: default is now a full DAG walk capped atcommitScanLimit. If the cap is hit with zero matches, it auto-falls back to an uncapped walk and prints a one-lineSearching full history (no match in last N commits)…note.--search-allstill skips straight to uncapped for callers who know the target is older than the cap.Removes the now-unused
computeReachableFromMain/walkFirstParentCommitshelpers and their direct test.Examples
Test plan
mise run check(fmt + lint + unit/integration/canary E2E) passesentire checkpoint liston a feature branch shows checkpoints reachable from HEAD, including those on merged branchesentire checkpoint list main..matches the prior feature-branch viewentire checkpoint list main...HEADerrors with a hintentire checkpoint explain <id>for a checkpoint on a merged branch finds the associated commit without--search-allNote
Medium Risk
Changes the default checkpoint/associated-commit discovery semantics to walk the full git DAG (including merged branches) and adds revision-range parsing, which could affect performance and the set/order of checkpoints shown. Risk is mitigated by scan caps with fallback behavior and expanded unit test coverage around merge scenarios and range parsing.
Overview
entire checkpoint listnow accepts an optional positional git-style revision range (e.g.main..,A..B,<ref>) and defaults togit log-like reachability fromHEAD, including checkpoints introduced via merged feature branches.Checkpoint discovery for both the list view and
entire explain <checkpoint>associated-commit lookup is refactored to walk the full DAG (instead of first-parent/default-branch filtering), with a bounded scan (commitScanLimit) and an automatic uncapped fallback that prints a one-line notice when needed. The PR removes the old first-parent/main-reachability helpers, updates CLI help/output labeling for scoped ranges, and adds/updates tests for merge-parent visibility, revision-range parsing, and the capped-scan fallback.Reviewed by Cursor Bugbot for commit f0f2fdb. Configure here.