Repository navigation
gc: detect squash-merged branches - #25
Merged
github-actions[bot] merged 2 commits intoNov 1, 2026
Merged
Conversation
|
VERDICT: rework
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Rework done (76c44ee):
|
|
VERDICT: accept
|
github-actions
Bot
deleted the
improve/F-1-gc-detect-squash-merged-branches
branch
November 1, 2026 00:36
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.
Friction
In a project where merge requests into the main branch are squash-merged,
dpcli gc --removeprinted "no merged branches" after the module was merged. The module branch and its task branch were never ancestors of the main branch, sogit branch --mergeddid not list them, and their copies and branches had to be removed by hand.Seen 1 time: one module, 2 branches (module branch + task branch), ledger entry F-1. A squash merge into the main branch is the default in that project, so every module ends this way.
Change
squash_merged()incommands/branches.py, used bygc:commit-treeof its tree) has a patch-id equivalent in the main branch (git cherryprints-).branch -D, because-drefuses them. Thegc_live_reasonand dirty-copy checks still apply.Tests
tests/test_gc.py:test_squash_merged: a module branch and its task branch are removed after a squash; an unrelated branch is kept.test_squash_then_more_work_and_empty_diff_kept: a branch that got a commit after its squash is kept, and so is a branch whose net diff is empty.Full suite: 207 OK. VERSION 35, CHANGELOG line.