Skip to content

Commit 0e7d715

Browse files
committed
test.sh draft
1 parent 0e2b0ed commit 0e7d715

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

t/test.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/sh
2+
3+
mkdir playground
4+
cd playground
5+
6+
# make (bare) parent.git repo
7+
mkdir parent
8+
cd parent
9+
git init
10+
echo parent > README
11+
cp ~/src/swanbase/git-fix-modules.sh .
12+
git add README git-fix-modules.sh
13+
git commit -m 'initial parent commit'
14+
mv .git ../parent.git
15+
cd ..
16+
rm -fr parent
17+
cd parent.git
18+
git config --bool core.bare true
19+
cd ..
20+
21+
# make (bare) dep.git repo
22+
mkdir dep
23+
cd dep
24+
git init
25+
echo dep > README
26+
git add README
27+
git commit -m 'initial dep commit'
28+
mv .git ../dep.git
29+
cd ..
30+
rm -fr dep
31+
cd dep.git
32+
git config --bool core.bare true
33+
cd ..
34+
35+
# repo owner: add dep as a subtrac-enhanced submodule
36+
git clone parent.git parent
37+
cd parent/
38+
git submodule add ../dep
39+
git add .gitmodules dep
40+
git commit -m 'add submodule'
41+
./git-fix-modules.sh
42+
git subtrac --auto-exclude update
43+
git push origin master master.trac
44+
cd ..
45+
46+
# repo contributor: clone
47+
git clone --recurse-submodules parent.git another-parent
48+
cd another-parent
49+
./git-fix-modules.sh
50+
cd dep
51+
git checkout master
52+
53+
# repo contributor: make local change
54+
echo 'local change' >> README
55+
git commit -m 'locally patch dep' README
56+
cd ..
57+
git commit -m 'record change in parent' dep
58+
git subtrac --auto-exclude update
59+
git push origin master master.trac
60+
cd ..
61+
62+
# upstream change
63+
git clone dep.git dep
64+
cd dep
65+
echo 'upstream change' >> README
66+
git commit -m 'upstream change' README
67+
git push origin master
68+
cd ..
69+
70+
# rebase parent/dep after upstream change
71+
cd parent/dep
72+
git fetch
73+
git rebase origin/master
74+
git commit -m 'rebase dep on upstream changes' dep
75+
git push origin master
76+
77+
# push parent/dep changes to upstream
78+
cd parent/dep
79+
git push origin master

0 commit comments

Comments
 (0)