Repository navigation
fix(git): count a commit already on origin/<base> as the base's, not the branch's - #54
Merged
Merged
Conversation
…the branch's Commits measured "not on base" against refs/heads/<base> alone. A local main that was never pulled after pull requests merged on the forge made every commit it lagged behind count as work of a branch cut from origin/main, so the attribution validator blocked `git push` on a commit merged weeks earlier. Commits now excludes every existing copy of the base (`git log HEAD --not refs/heads/<base> refs/remotes/origin/<base>`). Changed, a working-tree diff that takes one ref, diffs against the remote when the local base is merely behind it. Standing on the base branch still compares against the remote only. Plan: plans/attribution-stale-base.md
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 changed
git.Commitsmeasured "not on base" againstrefs/heads/<base>only. When localmainlagsorigin/main(the usual state once PRs merge on the forge), a branch cut fromorigin/mainclaimed every lagging commit as its own, and the attribution validator blockedgit pushon a commit merged long before.Commitsnow runsgit log HEAD --not <every existing copy of the base>— local andorigin/<base>. On the base branch itself it still compares against the remote only.Changed(single-ref working-tree diff) uses the remote base when the local one is merely behind it; a diverged local base keeps the old answer.Lookis unchanged (out of scope, see plan).Plan:
plans/attribution-stale-base.mdVerification
TestCommitsIgnoreWhatOnlyTheRemoteBaseHas,TestChangedDiffsAgainstTheFresherBase,TestAttributionIgnoresWhatIsAlreadyOnTheRemoteBase.scc validate --checks --pr: build, format, lint, tests (1005, coverage 86.2%) — 0 findings.main20 behindorigin/main: installedscc validatereportedattribution.co-authored-byon an already-merged commit; the fixed build reports no findings.Reviews
refs/heads/…/refs/remotes/origin/…(no flag injection); the local check remains spoofable by anyone controlling their own refs, as before this change.