fix(dispatch): surface merged work on feature branches with no own commits (ENT-1201)#1801
fix(dispatch): surface merged work on feature branches with no own commits (ENT-1201)#1801alishakawaguchi wants to merge 2 commits into
Conversation
…mmits (ENT-1201) `dispatch --local` returned an empty dispatch when run from a feature-branch worktree that has no commits of its own — the standard `marvin wt` / git-worktree setup where the branch sits on the up-to-date default branch. The local engine scopes a non-default branch to <default>..HEAD to isolate the branch's own work. When the branch has no unique commits that range is empty, so the reachable-checkpoint-trailer set is empty and every merged checkpoint is dropped — "no activity" reported while HEAD is sitting on a full window of merged work. ENT-1188 already recognized this empty-range problem but patched it only for the literal default branch, matched by name. The real predicate is "is there any branch-specific history to isolate?", so detect the empty range directly and fall back to summarizing everything reachable from HEAD — the same reasoning ENT-1188 applied to the default branch, generalized. Feature branches with their own commits keep the scoped <default>..HEAD view unchanged. A git failure while measuring the range is treated as non-empty, so the exclusion is preserved on error (never widens scope). Note: the default/cloud `entire dispatch` emptiness for entireio/cli is a separate backend `dispatches/generate` bug (the backend holds the checkpoints — its activity view reports them — but the dispatch generator returns 0); the CLI sends a correct request. That half is out of scope for this repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XL2teZnsLbEw2xPSy2f9Rs Entire-Checkpoint: 01KXRRKGDK6VHPYCVE28QW1R8R
|
bugbot run |
There was a problem hiding this comment.
Pull request overview
Fixes a local-dispatch edge case where dispatch --local could incorrectly report “no activity” when run from a feature-branch worktree that has no commits unique to that branch (i.e., <default>..HEAD is empty), by falling back to summarizing everything reachable from HEAD in that situation.
Changes:
- Generalize the “default branch has nothing to exclude” logic to any empty
<base>..HEADrev-range, ensuring merged work is still surfaced. - Add
revRangeIsEmptyto detect empty rev-ranges and keep scope conservative on git errors (do not widen). - Add a regression test covering feature-branch worktrees with no unique commits (ENT-1201).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/entire/cli/dispatch/mode_local.go | Detects empty <base>..HEAD and falls back to HEAD so merged checkpoint trailers aren’t dropped in local dispatch. |
| cmd/entire/cli/dispatch/mode_local_test.go | Adds regression coverage for feature-branch worktrees that share HEAD with the default branch (empty range). |
| func revRangeIsEmpty(ctx context.Context, repoRoot, revRange string) bool { | ||
| out, ok := runGitOutput(ctx, repoRoot, "rev-list", "--count", revRange) | ||
| if !ok { | ||
| return false | ||
| } | ||
| return base + "..HEAD" | ||
| return strings.TrimSpace(out) == "0" |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f70b18a. Configure here.
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f70b18a. Configure here.
https://entire.io/gh/entireio/cli/trails/898
dispatch --localreturned an empty dispatch when run from a feature-branchworktree that has no commits of its own
The local engine scopes a non-default branch to ..HEAD to isolate the
branch's own work. When the branch has no unique commits that range is empty,
so the reachable-checkpoint-trailer set is empty and every merged checkpoint is
dropped — "no activity" reported while HEAD is sitting on a full window of
merged work.
ENT-1188 already recognized this empty-range problem but patched it only for the
literal default branch, matched by name. The real predicate is "is there any
branch-specific history to isolate?", so detect the empty range directly and
fall back to summarizing everything reachable from HEAD — the same reasoning
ENT-1188 applied to the default branch, generalized. Feature branches with their
own commits keep the scoped ..HEAD view unchanged.
A git failure while measuring the range is treated as non-empty, so the
exclusion is preserved on error (never widens scope).
Note: the default/cloud
entire dispatchemptiness for entireio/cli is aseparate backend
dispatches/generatebug (the backend holds the checkpoints —its activity view reports them — but the dispatch generator returns 0); the CLI
sends a correct request. That half is out of scope for this repo.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01XL2teZnsLbEw2xPSy2f9Rs
Entire-Checkpoint: 01KXRRKGDK6VHPYCVE28QW1R8R
Note
Low Risk
Localized change to local dispatch rev-range selection with conservative git-error handling and a dedicated regression test; no auth, data, or API surface changes.
Overview
dispatch --localno longer returns an empty summary when run from a feature-branch worktree that shares HEAD with the default branch and has no commits of its own (typical git-worktree /marvin wtsetup).branchLocalRevRangestill scopes non-default branches to<default>..HEADto isolate branch-only work, but it now checks whether that range is empty viarevRangeIsEmpty(git rev-list --count). When the count is zero, it falls back toHEADso merged checkpoint trailers on the current tip are included—the same behavior ENT-1188 applied only when the current branch matched the default by name. Feature branches that actually have unique commits keep the scoped range unchanged.If measuring the range fails, the code treats the range as non-empty so scope is never widened on error. A regression test covers the fresh worktree-branch scenario (ENT-1201).
Reviewed by Cursor Bugbot for commit f70b18a. Configure here.