Repository navigation
feat(repo-ledger): name branches whose changes already landed by patch content - #1
Merged
Merged
Conversation
…h content A squash- or rebase-merged branch kept locally still counts as unique, because its original commits are on no remote ref. Each branch now also reports unlanded_commits: unique commits with no patch-equivalent on a remote default branch (its HEAD, else main, else master), or zero when one commit there carries the patch of the branch's whole diff. The repo summary lists those branches as branches_already_landed. Unique counts and at_risk are unchanged. Patch text comes from git's own diff with external diff, textconv and signature checks off, so repository config still cannot run a command. Each default branch is read once and a full branch diff is built only when its file set matches a commit there.
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.
What
repo-ledger now names local branches whose changes already reached a remote default branch through a squash or rebase merge. Before this, such a branch counted only as unique, because its original commits sit on no remote ref.
unlanded_commits: the unique commits with no patch-equivalent commit on a remote default branch. The default branch is the remote's HEAD, elsemain, elsemaster. The count is 0 when one commit there carries the patch of the branch's whole diff, which is what a squash merge leaves behind.branches_already_landed, and the markdown report lists those branch names.uniquecounts andat_riskare unchanged. A branch listed as already landed is still worth agit cherry -vbefore you delete it.Safety
Patch text comes from git's own diff, run with
--no-ext-diff --no-textconv --no-color, and log runs with--no-show-signature. That way repository config still cannot make the inventory run a command. A test configures an external diff driver, a textconv filter and a gpg program that each write a marker file, then checks that no marker appears.Cost
Each default branch is read once, back to the common ancestor of the local branches. A full branch diff is built only when the branch's set of changed files matches a commit there. On the workspaces repo (346 local branches) a run takes about 72 s, against about 31 s for Yearend Planner plus workspaces before this change.
docs/concepts.mdnotes this.Known misses
An earlier draft matched path-limited partial diffs. It marked 2 more workspaces branches as landed, but those branches still had commits that
git cherryreports as not upstream. The exact match is kept because it is the conservative choice.Tests
66 passed locally (
tools/repo-ledger/testsplustests). New tests:mainRemote refs in tests are set with
git update-ref.