From 93c608091f68d4a8f9de8620a181e3be96a28a48 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Tue, 19 May 2026 13:26:07 -0700 Subject: [PATCH 1/2] [Internal] Changelog: Adds .gitattributes union merge driver for changelog 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> --- .gitattributes | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..d804223779 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# Auto-resolve changelog merge conflicts by taking both sides' bullets. +# Background: 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) moves those bullets into a versioned section. Both shapes +# produce textbook merge conflicts. The `union` driver takes lines from both +# sides on conflict, which is exactly the "take both bullets" rule already +# documented in CONTRIBUTING.md (## Changelog entry > Merge conflicts). +# Caveat: if two PRs edit the SAME line (rare for append-only bullet lists), +# union loses information silently. For the Unreleased + versioned-section +# pattern this is acceptable; reviewers should still eyeball changelog diffs. +changelog.md merge=union +Microsoft.Azure.Cosmos/FaultInjection/changelog.md merge=union From fb1ea07ea8d1d110781aea28edb763646b6bac88 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <223556219+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 15:23:15 -0700 Subject: [PATCH 2/2] [Internal] Changelog: Refactors gitattributes patterns to anchor to repo 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> --- .gitattributes | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index d804223779..226746499c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,5 +8,11 @@ # Caveat: if two PRs edit the SAME line (rare for append-only bullet lists), # union loses information silently. For the Unreleased + versioned-section # pattern this is acceptable; reviewers should still eyeball changelog diffs. -changelog.md merge=union -Microsoft.Azure.Cosmos/FaultInjection/changelog.md merge=union +# Patterns are anchored with a leading `/` so they apply only to the two +# changelogs in scope (main SDK + FaultInjection). Without anchoring, git +# matches gitignore-style at any depth and would also catch +# Microsoft.Azure.Cosmos.Encryption/changelog.md and +# Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md, which #5864 +# explicitly deferred. +/changelog.md merge=union +/Microsoft.Azure.Cosmos/FaultInjection/changelog.md merge=union