Pin the merge method per direction, and show rebase is safe here - #8
Merged
Conversation
Squash into develop, rebase into main. GitHub cannot enforce a method per branch, so this is written down rather than configured; both methods stay enabled because both are correct somewhere. Also records why rebasing between two long-lived branches is safe, since it is a fair thing to worry about: rebase-merge rewrites commits, so main never becomes an ancestor of develop, and after a hotfix has been ported back the merge base falls behind both. The next release therefore *looks* like it would replay commits already on main. It doesn't — git rebase drops already-applied commits by patch-id. Verified rather than assumed: after a release, a hotfix on main and a cherry-pick back to develop, rebasing develop onto main listed three candidate commits and replayed exactly one. The edge case is documented too: a port-back that was conflict-resolved differently no longer matches by patch, so rebase will retry it. That shows up as a conflict at release time, which is visible and fixable rather than silent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Settles the open question: squash into
develop, rebase intomain. Merge commits stay disabled.feature/*→developdevelop→mainrelease/*/hotfix/*→maindevelopGitHub can't enforce a method per branch, so this is written down rather than configured. Both methods stay enabled because both are correct somewhere. Repo settings are unchanged and already correct:
merge_commit: false,squash: true,rebase: true.Why rebase between two long-lived branches is safe
This is worth recording because it's a fair thing to worry about, and I nearly talked us out of rebase over it.
Rebase-merge rewrites commits, so
mainnever becomes an ancestor ofdevelop. Once a hotfix lands onmainand is ported back, the merge base falls behind both — so the next release looks like it would replay commits already present onmain.It doesn't.
git rebasedetects already-applied commits by patch-id and drops them. Verified rather than assumed — simulated a release, a hotfix onmain, and a cherry-pick back todevelop:Three candidates, one replayed, no conflict and no duplicates.
The edge case is documented too: a port-back that was conflict-resolved differently from the original no longer matches by patch, so rebase will retry it. That surfaces as a conflict at release time — visible and fixable, not silent corruption.
Also
PR template now states the base branch and merge method, since those are the two things easiest to get wrong under GitFlow.
Incidentally this is the first PR under the new flow —
feature-style branch offdevelop, targetingdevelop. Being docs-only, it should bebuild-skip.ymlthat reports the required check rather than a real build.🤖 Generated with Claude Code