Skip to content

Commit 7c523eb

Browse files
committed
version sent to Michael
1 parent 6c584e3 commit 7c523eb

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

git-imerge-test-create.sh

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
#!/bin/bash
2+
# ./git-imerge-test-create.sh
23
# Written by Wilson Mar ([email protected])
3-
# This creates commits
4+
# This creates the conditions for testing Michael Haggerty's "git imerge",
5+
# as described in https://wilsonmar.github.io/git-imerge
6+
#
7+
# Before running this, copy this file to the folder where you want the test repo created,
8+
# then chmod 555 git-imerge-test-create.sh
9+
# Running this creates a folder above the script folder
10+
# and creates a file named somefile.md in both the floob branch and "frob" branch.
411
# This file is in https://github.com/wilsonmar/git-utilities/git-imerge-test-create.sh
512

13+
614
function conflict { # $1=letter $2=cnt number
715
x="$1$2"
816
if [ $x = B2 ]||[ $x = G7 ]||[ $x = I9 ]; then
9-
commit "$x tlub" $1 tlub
10-
commit "$x master" $2 master
17+
commit "$x frob" $1 frob
18+
commit "$x floob" $2 floob
1119
else
12-
commit "$x" $1 tlub
13-
commit "$x" $2 master
20+
commit "$x" $1 frob
21+
commit "$x" $2 floob
1422
fi
1523
}
1624

@@ -25,10 +33,10 @@ function commit { # $1=content, $2=msg
2533

2634
##########
2735

28-
echo "## Change directory up to avoid using git-utilities own repo:"
29-
cd ..
30-
mkdir $1
31-
cd $1
36+
#echo "## Change directory up to avoid using git-utilities own repo:"
37+
#cd ..
38+
#mkdir $1
39+
#cd $1
3240

3341
echo "## Deleting .git and somefile.md from previous run:"
3442
rm -rf .git
@@ -38,9 +46,9 @@ echo "## Initializing repo with commit and branches:"
3846
git init
3947
touch somefile.md
4048
git add somefile.md
41-
git commit -m"Initial commit somefile.md"
42-
git branch tlub
43-
git branch master
49+
git commit -m"0"
50+
git branch frob
51+
git branch floob
4452
git branch -avv
4553

4654
echo "## Generating commits in branches:"
@@ -51,12 +59,20 @@ for i in ${letters[@]}; do
5159
cnt=$((cnt+1)) # increment
5260
done
5361

54-
echo "## Verifying contents of branch tlub and file somefile.md:"
62+
echo "## Verifying contents of branch frob and file somefile.md:"
5563
git log --pretty=format:"%h %s %ad" --graph --since=1.days --date=relative;
56-
git checkout tlub
64+
git checkout frob
5765
cat somefile.md
58-
echo "## Verifying contents of branch master and file somefile.md:"
66+
echo "## Verifying contents of branch floob and file somefile.md:"
5967
git log --pretty=format:"%h %s %ad" --graph --since=1.days --date=relative;
60-
git checkout master
68+
git checkout floob
6169
cat somefile.md
62-
#ls -al
70+
git branch -avv
71+
#ls -al
72+
# You should now have:
73+
# 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 ' ← floob
74+
# \
75+
# A -- B -- C --- D --- E --- F --- G --- H --- I ← branch
76+
git checkout frob
77+
git-imerge start --name=NAME --goal=full floob
78+
git imerge diagram --name=NAME

0 commit comments

Comments
 (0)