[Internal] Changelog: Adds .gitattributes union merge driver for changelog files#5889
[Internal] Changelog: Adds .gitattributes union merge driver for changelog files#5889NaluTripician wants to merge 2 commits into
Conversation
…gelog files PR #5864 moved the SDK to a per-PR `### Unreleased` model where every shipped-source PR appends a bullet to the same anchor, and each release PR (e.g. #5876) sweeps those bullets into a versioned section. Both shapes produce textbook merge conflicts on `### Unreleased` for every in-flight PR (recent hits: #5829, #5868). This change registers the git `union` merge driver for the two changelog files shipped in this repo. On conflict, git takes lines from both sides - exactly the "take both bullets" rule already documented in CONTRIBUTING.md (## Changelog entry > Merge conflicts). Scope: only `.gitattributes` is added. No production / test / CI changes. Encryption changelogs are intentionally deferred per #5864. Caveat: if two PRs edit the SAME line (rare for append-only bullet lists), union loses information silently. Reviewers should continue to eyeball changelog diffs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kushagraThapar
left a comment
There was a problem hiding this comment.
Thank you for tackling this — the ### Unreleased merge-conflict pain is real and the union driver is exactly the right hammer. The PR is small, well-scoped, has great inline rationale in .gitattributes, and the end-to-end smoke test in the description is excellent evidence.
Approving with one small nit you may want to address either in this PR or as a follow-up — see the inline comment. It's about the pattern being unanchored and therefore accidentally matching the Encryption changelogs that #5864 explicitly deferred. Behavior impact is benign (those changelogs are append-only too, so union would also Do The Right Thing there), but the scope mismatch with the PR body is worth tightening.
Nice work overall — and the CONTRIBUTING.md cross-reference + caveat about same-line edits is the kind of thoughtful framing that makes this easy to review. 🚢
…epo root Per review feedback from @kushagraThapar (and the matching question from @kundadebdatta): without a leading slash, git attribute patterns match gitignore-style at any depth, so the original lines also applied to Microsoft.Azure.Cosmos.Encryption/changelog.md and Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md - both of which #5864 explicitly deferred from this change. Anchoring both patterns with a leading '/' restores the stated PR scope: changelog.md: merge: union Microsoft.Azure.Cosmos/FaultInjection/changelog.md: merge: union Microsoft.Azure.Cosmos.Encryption/changelog.md: merge: unspecified Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md: merge: unspecified Also expands the header comment to record the anchoring rationale so a future contributor doesn't drop the leading slashes by accident. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fb1ea07
Problem
PR #5864 moved the SDK to a per-PR
### Unreleasedmodel where every shipped-source PR appends a bullet to the same anchor, and each release PR (e.g. #5876) sweeps those bullets into a versioned section. Both shapes produce textbook merge conflicts on### Unreleasedfor every in-flight PR. Concrete recent hits: #5829 and #5868.Fix
Register the git
unionmerge driver for the two changelog files shipped in this repo:changelog.md(main SDK)Microsoft.Azure.Cosmos/FaultInjection/changelog.mdOn conflict, git takes lines from both sides — exactly the "take both bullets" rule already documented in
CONTRIBUTING.mdunder Changelog entry → Merge conflicts. The manual rule remains valid as a reviewer-eyeball backstop; the union driver just automates the common case.Scope
Exactly one file added (
.gitattributes). Zero production / test / CI changes. Encryption changelogs are intentionally not included, deferred per #5864.Caveat
If two PRs edit the same line — rare for append-only bullet lists, but possible during release sweeps that rewrite history blocks —
unionsilently keeps both sides' versions of that line. Reviewers should continue to eyeball changelog diffs on conflict-prone PRs.Validation
1.
git check-attrconfirms the driver applies to both targets:2. End-to-end smoke test in a scratch worktree — two throwaway branches each appended a different bullet to
### Unreleased, then merged. With the driver in place the merge auto-resolved cleanly:The scratch worktree and its branches were discarded after the test; the PR contains only
.gitattributes.3. Build sanity check:
Changelog entry
.gitattributes). Does not modify any file underMicrosoft.Azure.Cosmos/src/**orFaultInjection/src/**. Step 1 of the classifier in.github/copilot-instructions.mdshort-circuits to "no entry required."Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com