Repository navigation
Diff badge stops counting work that already merged - #277
Merged
Merged
Conversation
A squash or rebase merge never moves the merge-base, so the badge kept every merged line forever (+5465 on a task whose PR had landed). Count what the branch would still contribute to origin/<base> instead, via an in-memory git merge-tree, with a base-history check for files base edited again. Also: fetch origin/<base> (per repo, throttled) before counting, follow the worktree's current branch when detecting merges, and stop unstaged edits overwriting the committed count for the same file.
Merged
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.
After a squash merge done outside Ateam (an agent's
gh pr merge), a task kept showing the whole branch as changes (+5465 on a task whose PR had merged) and its card saidclosed.Why
git diff --merge-base origin/<base>. A squash or rebase merge never moves the merge-base, so merged lines counted forever.origin/<base>was never fetched after a merge outside Ateam.detectMergedasked abouttask.branch, but agents and loop runs cut fresh branches inside their worktree.Change
diff/fileDiff: files the branch no longer contributes (git merge-tree --write-tree, in memory, no index lock) count only edits on top of HEAD. Conflicted files count as landed when base held HEAD's exact version at some point since the fork. Older git, or noorigin/<base>, keeps today's numbers.gitDiffRPC fetchorigin/<base>first: once per repo per 5 min, 5s cap, reusingfetchBase.detectMergedfollows the worktree's current branch.--merge-basepass already covers the working tree, so the staged/unstaged override is dropped.Verified
.codex/), PR #2286 merged (wasclosed). openvideo goes to +0, #2288 merged.Ceiling: committing again on a file after it was squash-merged falls back to the full merge-base count for that file.