aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/create-second-pack
blob: 7241fa694c9230c8aa2b13a06ff3807cc1ad7dcf (plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/bash -ex

export GIT_COMMITTER_NAME="A U Thor"
export GIT_AUTHOR_NAME="A U Thor"
export GIT_COMMITTER_EMAIL="a.u.thor@example.com"
export GIT_AUTHOR_EMAIL="a.u.thor@example.com"

test_tick () {
	# from git/t/test-lib.sh
	if test -z "${test_tick+set}"
        then
                test_tick=1112911993
        else
                test_tick=$(($test_tick + 60))
        fi
        GIT_COMMITTER_DATE="$test_tick -0700"
        GIT_AUTHOR_DATE="$test_tick -0700"
        export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
}

git_commit () {
	test_tick
	git commit "$@"
}

git_merge () {
	test_tick
	git merge "$@"

}

test_tick
rm -rf .git *.txt ?
git init
echo "On master" >>master.txt
git add master.txt
git_commit -a -m "On master"

echo "On master" >>master.txt
git_commit -a -m "On master again"

git checkout -b a 6c8b137b1c652731597c89668f417b8695f28dd7
mkdir a

echo a1 >>a/a1.txt
git add a/a1.txt
git_commit -a -m "First a/a1"

echo a2 >>a/a2.txt
git add a/a2.txt
git_commit -a -m "First a/a2"

git merge master

echo a1 >>a/a1.txt
git add a/a1.txt
git_commit -a -m "Second a/a1"
git branch pa

echo a2 >>a/a2.txt
git add a/a2.txt
git_commit -a -m "Second a/a2"

git checkout -b b 58be4659bb571194ed4562d04b359d26216f526e

mkdir b
echo b1 >>b/b1.txt
git add b/b1.txt
git_commit -a -m "First b/b1"

echo b2 >>b/b2.txt
git add b/b2.txt
git_commit -a -m "First b/b2"

git merge a

echo b1 >>b/b1.txt
git add b/b1.txt
git_commit -a -m "Second b/b1"

echo b2 >>b/b2.txt
git add b/b2.txt
git_commit -a -m "Second b/b2"

rm -rf a b c master.txt
mkdir c
rm -f ./git/index
echo ref: refs/heads/c >.git/HEAD

echo c1 >>c/c1.txt
git add c/c1.txt
git_commit -a -m "First c/c1, no parent"

echo c2 >>c/c2.txt
git add c/c2.txt
git_commit -a -m "First c/c2"

git_merge a

echo c1 >>c/c1.txt
git add c/c2.txt
git_commit -a -m "Second c/c1"

echo c2 >>c/c2.txt
git add c/c2.txt
git_commit -a -m "Second c/c2"

git_merge b

git checkout -b d a

echo "a1" >>a/a1
git add a/a1
git_commit -a -m "Third a/a1"

git checkout -b e a

echo "a1" >>a/a1
git add a/a1
git_commit -a -m "Fourth a/a1"

git checkout master

git_merge c d e

git repack -d

git tag A a
git tag -a -m "An annotated tag" B a^

git repack -d

Bnth=B
for nth in 2nd 3rd 4th 5th 6th 7th 8th 9th 10th; do
	git tag -a -m "An $nth level annotated tag" "B$nth" "$Bnth"
	Bnth="B$nth"
done

git repack -d

git checkout -b f a
mkdir f
echo "an eff" >f/f
git add f/f
git commit -m "An eff"
git checkout -b g a
mkdir f
echo "an F" >f/f
git add f/f
git commit -m "An F"

git repack -d

git checkout -b symlink master
ln -s c/c1.txt symlink.txt
git add symlink.txt
git_commit -m "A symlink"

git checkout -b gitlink master
git submodule add "$(pwd)/.git" submodule
git_commit -m "A gitlink"

git repack -d
git pack-refs --all

gitk --all master