-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_testdata.sh
More file actions
executable file
·64 lines (49 loc) · 2.49 KB
/
Copy pathcreate_testdata.sh
File metadata and controls
executable file
·64 lines (49 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -ex
rm -rf "testdata/simpletag"
mkdir -p "testdata/simpletag"
cd "testdata/simpletag"
git init -q
export GIT_AUTHOR_NAME="Dummy"
export GIT_AUTHOR_EMAIL="example@example.com"
export GIT_COMMITTER_NAME="Dummy"
export GIT_COMMITTER_EMAIL="example@example.com"
# Branch A: Initial commits
touch file.txt
echo "A1" > file.txt && git add . && git commit --no-gpg-sign -m "[a1] Initial commit on main"
echo "A2" > file.txt && git add . && git commit --no-gpg-sign -m "[a2] Second commit on main"
echo "A3" > file.txt && git add . && git commit --no-gpg-sign -m "[a3] Point of divergence for branch B"
# Branch B: Create and add commits
git checkout -b branch-B
echo "B1" > file.txt && git add . && git commit --no-gpg-sign -m "[b1] First commit on branch B"
echo "B2" > file.txt && git add . && git commit --no-gpg-sign -m "[b2] Second commit on branch B"
echo "B3" > file.txt && git add . && git commit --no-gpg-sign -m "[b3] Final commit on branch B before merge"
# Branch A: Resume and Merge
git checkout master # or 'main' depending on your default
echo "A4" > file.txt && git add . && git commit --no-gpg-sign -m "[a4] Parallel work on main"
# A5 is the merge commit
git merge branch-B -X theirs --no-gpg-sign -m "[merge] Merge branch B into main"
# Final commit on A
echo "A6" > file.txt && git add . && git commit --no-gpg-sign -m "[a6] Final post-merge commit"
cd ../
rm -rf "simpletag_fail"
mkdir -p "simpletag_fail"
cd "simpletag_fail"
git init -q
# Branch A: Initial commits
touch file.txt
echo "A1" > file.txt && git add . && git commit --no-gpg-sign -m "[a1] Initial commit on main"
echo "A2" > file.txt && git add . && git commit --no-gpg-sign -m "[a2] Second commit on main"
echo "A3" > file.txt && git add . && git commit --no-gpg-sign -m "[a3]"
# Branch B: Create and add commits
git checkout -b branch-B
echo "B1" > file.txt && git add . && git commit --no-gpg-sign -m "[b1] First commit on branch B"
echo "B2" > file.txt && git add . && git commit --no-gpg-sign -m "|tag| Second commit on branch B"
echo "B3" > file.txt && git add . && git commit --no-gpg-sign -m "[B3] Final commit on branch B before merge"
# Branch A: Resume and Merge
git checkout master # or 'main' depending on your default
echo "A4" > file.txt && git add . && git commit --no-gpg-sign -m "Parallel work on main"
# A5 is the merge commit
git merge branch-B -X theirs --no-gpg-sign -m "[merge] Merge branch B into main"
# Final commit on A
echo "A6" > file.txt && git add . && git commit --no-gpg-sign -m "[a6] final post-merge commit"