Repository navigation
DOC: State the release-branch merge-forward rules for agents - #7233
Conversation
Maintenance branches reach main by merge, release-X.X into release into main, so release tags stay ancestors of main and conflicts are resolved while small. The rules were split between contributing/index.md and Release.md, and agents had no entry point, so a backport could stop at the cherry-pick. Add Documentation/AI/release-branches.md with the branch-start table, the merge-forward rules, and git checks that print nothing when the branches conform, and route to it from AGENTS.md. In contributing, add the cherry-pick path Release.md already allows and when to merge forward.
[Medium impact] The guidance reaches contributors, agents, and release managers working on maintenance branches. This documentation-only PR appears safe to merge, with non-blocking corrections recommended for the checks and conflict instructions. Findings
|
| git log --oneline --no-merges upstream/release..upstream/release-5.4 | ||
| git log --oneline --no-merges upstream/main..upstream/release | ||
| git log --oneline --no-merges upstream/main..upstream/release-5.4 |
There was a problem hiding this comment.
--no-merges hides commits these checks need to catch. If a topic reaches both branches through separate merges, the maintenance branch can still have an unmerged merge commit while these commands print nothing. A fix made while resolving that merge can also be missed.
Remove --no-merges, or check each maintenance branch tip with git merge-base --is-ancestor and print failures.
| git log --oneline --no-merges upstream/release..upstream/release-5.4 | |
| git log --oneline --no-merges upstream/main..upstream/release | |
| git log --oneline --no-merges upstream/main..upstream/release-5.4 | |
| git log --oneline upstream/release..upstream/release-5.4 | |
| git log --oneline upstream/main..upstream/release | |
| git log --oneline upstream/main..upstream/release-5.4 |
| - A conflict where `main` already holds the fix in a newer form resolves to | ||
| `main`'s version. After resolving, `git diff upstream/main HEAD` shows only | ||
| what the maintenance branch adds (release notes, a version-specific | ||
| change); anything else is a resolution error. |
There was a problem hiding this comment.
First merge targets wrong branch
During release-X.X → release, main is not the destination and can contain newer development that must stay out of release. Comparing that result with upstream/main also shows legitimate development differences, not just resolution errors. The contributing guide repeats this guidance.
Use release's form and compare against upstream/release for the first step. Reserve the current guidance for release → main.
| for t in $(git ls-remote --tags --refs upstream 'v5.4*' 'v6*' | sed 's#.*refs/tags/##'); do | ||
| git merge-base --is-ancestor "$t" upstream/main || echo "$t" | ||
| done | ||
| ``` | ||
|
|
||
| Use upstream's tags, as above; a stale local tag gives a false report. |
There was a problem hiding this comment.
The loop checks local tags despite the warning below it. git ls-remote supplies upstream names, but the command discards their object IDs and resolves "$t" locally. If a local tag differs, git fetch --tags refuses to replace it. The block then continues and checks the stale tag, which can report the wrong ancestry result.
Fetch upstream tags into a separate namespace and check those refs, or stop on fetch failure and explain how to resolve a tag mismatch.
Write down the release-branch merge-forward rules (
release-X.X→release→main, each by--no-ffmerge) in one place agents load, with git checks that print nothing when the branches conform. AddsDocumentation/AI/release-branches.md, anAGENTS.mdroute, the cherry-pick pathRelease.mdalready allows to the contributing guide, and a post-release check step inRelease.md.Merge danger: two-way door; documentation only.
Not yet conformant: three
release-5.4commits have not been merged forward. Two follow-up merge PRs, one at a time, are listed below; this PR does not perform them.Shape of the change
The rules come from the existing docs and from the #5339 review threads (dzenanz: resolve conflicts "soon after the commits which cause them have been integrated"; thewtex: keep "master, release, release-X.X branches connected"). The "conflicts resolve to
main's newer form" rule is the one #7155 applied to all ten of its conflicts.Current state, from the checks in release-branches.md
Run 2026-11-24 against upstream:
upstream/release..upstream/release-5.4upstream/main..upstream/releaseupstream/main..upstream/release-5.4v5.4*andv6*tags not ancestors ofmain(18 checked)The three commits:
39c138c6208COMP: Update release-5.4 CastXML binaries to v2026.01.30 (COMP: Update release-5.4 CastXML binaries to v2026.01.30 #7221)8d0cd4c029bCOMP: Keep vendored HDF5 on the OLD behavior of CMP0175 and CMP0219 (CMake policy version fixes (release-5.4) #7232)42037653878COMP: Stop resetting CMake policies in Wrapping and in-tree modules (CMake policy version fixes (release-5.4) #7232)Follow-up PRs to restore conformance (one at a time)
release-5.4intorelease. Agit merge-treedry run conflicts in 7 files:Wrapping/Generators/CastXML/CMakeLists.txtand theCMakeLists.txtof GPUCommon (plus itswrapping/), GPUFiniteDifference, GPUAnisotropicSmoothing, GPUImageFilterBase, and GPUSmoothing. These are the 5.4 forms of COMP: Bump validated CMake policies version to 4.5.0 #7219's policy fixes and the 5.4 CastXML pin;release(6.0b02 line) already has its own forms, so each should resolve torelease's version unless it lacks the change. The PR lists each conflict and resolution.releaseintomain, after step 1 merges. A dry run ofrelease-5.4straight intomainconflicts in 4 files (CastXML, GPUCommon and itswrapping/, andModules/Numerics/FEM/CMakeLists.txt, deleted onmain), all expected to resolve tomain. Thengit diff upstream/main HEADshould show nothing beyond whatreleaseadds.Each follow-up is opened only when a release manager asks for it, per the page's Agent defaults.
Evidence
git merge-tree --write-tree --name-only --messages upstream/release upstream/release-5.4and the same againstupstream/main.pre-commit run --all-filespasses, including the prose-budget hook withITK_AI_AGENT=1.Not checked: the docs site build (the contributing page links the new file by its GitHub URL, as it already does for
migration-records.md).AI assistance
Help/dev/maint.rst; drafted the page; ran the checks and dry-run merges