chore: mark CHANGELOG.md with git's union merge driver - #2987
Merged
Conversation
Nearly every PR appends an entry to CHANGELOG.md, so two concurrent PRs routinely produce a textual conflict whose correct resolution is always "keep both entries". Marking the file merge=union makes git take both sides automatically. union is a built-in driver, so no per-clone git config is required for contributors, CI, or merges done on GitHub.
|
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
chernser
approved these changes
Jul 31, 2026
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
Adds a root
.gitattributesmarkingCHANGELOG.mdwith git's built-inmerge=unionmerge driver. The repo previously had no.gitattributesat all; this file contains exactly one rule and nothing else.Why
The changelog is an append-at-the-top-of-a-section file that nearly every PR touches. When two PRs each add an entry, git's default 3-way merge raises a textual conflict even though the intended resolution is unambiguous and always the same — keep both entries. That conflict then has to be resolved by hand on every concurrent PR (e.g. #2936 conflicted three times in ~36 hours purely on changelog churn). With
merge=union, git takes both sides of a conflicting hunk instead of failing.unionis one of git's built-in merge drivers, so nogit configand no per-clone setup is needed — it works for every contributor, for CI, and for merges performed on GitHub.The rule is scoped to the changelog only. In particular this file deliberately adds no
text/eolnormalisation: introducing that into a repo that has never had a.gitattributescould renormalise files tree-wide, which would be a large, risky, unrelated diff.docs/changes_checklist.mdis a process doc, not a changelog, and is not covered.Corner cases (stated honestly)
There are two ways union merge can produce a wrong-but-harmless result. Both land as plain text in the PR diff, so a reviewer can catch and fix them:
### New Featuresheading) at different positions in the file, union merge keeps both copies and the heading appears twice. (If both add it in the same place with identical surrounding lines, git matches the shared context and the result is correct.)mainmeanwhile cut a release — moving that content under a new version heading — union merge will silently file the old PR's entry under the already-released section, and raises no conflict to flag it.Both are confined to the changelog, are visible in the diff, and are cheap for a reviewer to spot — which trades well against hand-resolving a conflict on essentially every concurrent PR.
Verification
git check-attr merge -- CHANGELOG.md docs/changes_checklist.md README.md pom.xml→CHANGELOG.md: merge: union, all othersunspecified.### New Features; merging them succeeds with both entries present and zero conflict markers.Notes