Skip to content

Commit b5c7130

Browse files
committed
Add merge strategy and simple color-coding to merge script
1 parent fe62480 commit b5c7130

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@
66

77
app-k9mail/build.gradle.kts merge=merge_gradle
88
app-thunderbird/build.gradle.kts merge=merge_gradle
9+
10+
app-thunderbird/src/release/res/raw/changelog_master.xml merge=ours
11+
app-thunderbird/src/beta/res/raw/changelog_master.xml merge=ours
912
app-k9mail/src/main/res/raw/changelog_master.xml merge=ours
13+
14+
app-metadata/com.fsck.k9/*/changelogs/** merge=ours
15+
app-metadata/net.thunderbird.android.beta/*/changelogs/** merge=ours
16+
app-metadata/net.thunderbird.android/*/changelogs/** merge=ours

scripts/ci/merges/do_merge.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ git checkout ${into_branch}
4343
git pull
4444
git config merge.ours.driver true
4545
git config merge.merge_gradle.driver "python3 scripts/ci/merges/merge_gradle.py %A %B"
46+
git config merge.merge_changelog.driver "scripts/ci/merges/merge_changelog.sh %A %O %B"
4647
set +e
47-
git merge "origin/${from_branch}"
48+
git merge -Xtheirs "origin/${from_branch}" 2>&1 | grep --color=always -E '\bCONFLICT\b|$'
4849
ret=$?
4950
set +x
5051

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# This merge driver exists to override the -Xtheirs CLI option used when merging
4+
# two trees together (e.g. main -> beta).
5+
6+
A="$1" # File A (ours)
7+
O="$2" # Common ancestor
8+
B="$3" # File B (theirs)
9+
10+
git merge-file -- "$A" "$O" "$B"

0 commit comments

Comments
 (0)