fix: prevent duplicate content in merge-previous-releases auto-merge - #283
Open
sleepytanya wants to merge 2 commits into
Open
fix: prevent duplicate content in merge-previous-releases auto-merge#283sleepytanya wants to merge 2 commits into
sleepytanya wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d0cc55f. Configure here.
sleepytanya
commented
Aug 27, 2026
| fi | ||
| # Reset all files to destination (new RC) version | ||
| echo "Resetting all files to destination branch version..." | ||
| git checkout HEAD -- . 2>/dev/null || true |
Contributor
Author
There was a problem hiding this comment.
@Gudahtt
Two edge cases: a) if old RC has content not yet in main, it gets discarded; b) if destination deleted file that source has, it gets un-deleted. Not sure if this can happen in real life?
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.

When merging older RCs into a new RC, git's auto-merge can create duplicate content (e.g., duplicate locale keys) when both branches have identical changes. This happens because git doesn't recognize the changes are the same and tries to combine them.
Fix: use
--no-commit --no-ff, then reset all files to destination before committing. This preserves merge history while keeping destination content.Fixes: https://consensyssoftware.atlassian.net/browse/MCRM-143
Note
Medium Risk
Changes release-branch automation that pushes merge commits; behavior now discards any post-merge tree differences from older RCs in favor of the new branch, which is intentional but affects production release flows.
Overview
Fixes
merge-previous-releasesso merging an older RC into a new one no longer duplicates content (e.g. repeated locale keys) when both branches contain the same edits—Git was combining identical changes instead of treating them as one.merge_with_favor_destinationno longer relies on-X oursand per-file conflict resolution. It runsgit merge --no-commit --no-ff, thengit checkout HEAD -- .to force the working tree to match the new RC, stages (still excludinggithub-tools), and commits the merge. Merge history is kept; file content always matches the destination branch.The script header comments and CHANGELOG document the new behavior and link PR #283.
Reviewed by Cursor Bugbot for commit cc52e72. Bugbot is set up for automated code reviews on this repo. Configure here.