Repository navigation
fix(distribute): prove a sync branch's base past a merge of an older branch - #44
Merged
Merged
Conversation
…branch The proof fetched the default branch back to a day before the commit it proves (--shallow-since). git cuts that history at a commit with a parent older than the date and drops all of its parents, so a merge of an old branch hid the default branch's own commits below it, and a sync branch on an older base was blocked as edited. git's "no" now counts only when no shallow boundary in the default branch's history is as new as that date; otherwise the history below the boundaries is fetched deeper by a count of commits and asked again.
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.
Summary
A sync branch whose commit sits on an older commit of the default branch was blocked as edited ("touchmark's commit … sits on commits that are not on the default branch") as soon as someone merged into the default branch, with a merge commit, a branch with a commit older than a day before that base. The open pull request was paused, and
plan --strictfailed in the hub's merge requests. Seen on a self-managed GitLab: the merged branch had a commit three days older than the sync branch's base.The proof fetches the default branch back to a day before the commit it proves (
--shallow-since). git cuts that history at a commit with a parent older than the date and drops all of its parents, so the merge of the old branch becomes a shallow boundary, the default branch's own commits below it are never fetched, andmerge-base --is-ancestoranswers no.The proof now takes git's "no" only when no shallow boundary in the default branch's history is as new as that date (
TargetRepo.ShallowNotBefore). Otherwise it fetches the history below the boundaries deeper by a count of commits (TargetRepo.Deepen,--deepen: 20, then 500) and asks again; what is still cut short after that stays unknown, and the branch stays blocked as before. A branch that sits on someone else's commit costs no extra fetch: no such boundary is in the default branch's history.TestDeepenOldMergeplays git's cut on a served repository.TestRunBranchOldMergeis the merge in the fake; before the fix it endedblocked:edited.Type of change
Checklist
make checkpasses locally (gofmt+go vet+golangci-lint+govulncheck): all butgovulncheck, which flags only the standard library of the local Go 1.26.0 (fixed in 1.26.1)CHANGELOG.mddocs/agents.mdincludedRelated issues
None.