Skip to content

Commit 715f061

Browse files
committed
Merge driver for llvm#826
1 parent c329de7 commit 715f061

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

clang/test/CIR/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/* merge=pr826

clang/test/CIR/pr826-merge-driver.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# See https://github.com/ldionne/llvm-project/blob/main/libcxx/utils/clang-format-merge-driver.sh
4+
# Install via (from repo root):
5+
# git config merge.pr826.name "Fix type alias names for https://github.com/llvm/clangir/pull/826"
6+
# git config merge.pr826.driver "clang/test/CIR/pr826-merge-driver.sh %O %A %B %P"
7+
8+
# Path to the file's contents at the ancestor's version.
9+
base="$1"
10+
11+
# Path to the file's contents at the current version.
12+
current="$2"
13+
14+
# Path to the file's contents at the other branch's version (for nonlinear histories, there might be multiple other branches).
15+
other="$3"
16+
17+
# The path of the file in the repository.
18+
path="$4"
19+
20+
sed -E -e 's/ty_22([A-Za-z0-9_$]+[0-9])22/ty_\1_/g' -e 's/ty_22([A-Za-z0-9_$]+)22/ty_\1/g' < "$base" > "$base.tmp"
21+
mv "$base.tmp" "$base"
22+
23+
sed -E -e 's/ty_22([A-Za-z0-9_$]+[0-9])22/ty_\1_/g' -e 's/ty_22([A-Za-z0-9_$]+)22/ty_\1/g' < "$current" > "$current.tmp"
24+
mv "$current.tmp" "$current"
25+
26+
sed -E -e 's/ty_22([A-Za-z0-9_$]+[0-9])22/ty_\1_/g' -e 's/ty_22([A-Za-z0-9_$]+)22/ty_\1/g' < "$other" > "$other.tmp"
27+
mv "$other.tmp" "$other"
28+
29+
git merge-file -Lcurrent -Lbase -Lother "$current" "$base" "$other"

0 commit comments

Comments
 (0)