-
Notifications
You must be signed in to change notification settings - Fork 54
/
setup-sandbox
executable file
·85 lines (73 loc) · 1.44 KB
/
setup-sandbox
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env bash
set -e -o pipefail -u
newb() {
git checkout -b $1
}
cmt() {
b=$(git symbolic-ref --short HEAD)
f=${b/\//-}-${1}-${2-}.txt
touch $f
git add $f
git commit -m "$*"
}
newrepo() {
dir=$1
rm -fr /tmp/_$dir
mv $root_dir/$dir /tmp/_$dir || true
mkdir $root_dir/$dir
cd $root_dir/$dir
opt=${2-}
git -c init.defaultBranch=master init $opt
}
push() {
b=$(git symbolic-ref --short HEAD)
git push -u origin $b
}
root_dir=$(realpath "${1-$HOME}")
newrepo machete-sandbox-remote --bare
newrepo machete-sandbox
git remote add origin $root_dir/machete-sandbox-remote
newb root
cmt Root
newb develop
cmt Develop commit
newb allow-ownership-link
cmt Allow ownership links
push
newb build-chain
cmt Build arbitrarily long chains
git checkout allow-ownership-link
cmt 1st round of fixes
git checkout develop
cmt Other develop commit
push
newb call-ws
cmt Call web service
cmt 1st round of fixes
push
newb drop-constraint # not added to branch layout file
cmt Drop unneeded SQL constraints
git checkout call-ws
cmt 2nd round of fixes
git checkout root
newb master
cmt Master commit
push
newb hotfix/add-trigger
cmt HOTFIX Add the trigger
push
git commit --amend -m 'HOTFIX Add the trigger (amended)'
cat >.git/machete <<EOF
develop
allow-ownership-link PR #123
build-chain
call-ws PR #124
master
hotfix/add-trigger
EOF
git branch -d root
echo
echo
git machete status
echo
echo