Clear up semantics of tree_status
[stgit/ydirson.git] / t / t4000-upgrade / make-repo.sh
blob98b502007a8505b6bb0655925784c54e2d3cb1de
1 # This script makes several versions of a small test repository that
2 # can be used for testing the format version upgrade code.
4 LANG=C
5 LC_ALL=C
6 PAGER=cat
7 TZ=UTC
8 export LANG LC_ALL PAGER TZ
9 unset AUTHOR_DATE
10 unset AUTHOR_EMAIL
11 unset AUTHOR_NAME
12 unset COMMIT_AUTHOR_EMAIL
13 unset COMMIT_AUTHOR_NAME
14 unset GIT_ALTERNATE_OBJECT_DIRECTORIES
15 unset GIT_AUTHOR_DATE
16 GIT_AUTHOR_EMAIL=author@example.com
17 GIT_AUTHOR_NAME='A U Thor'
18 unset GIT_COMMITTER_DATE
19 GIT_COMMITTER_EMAIL=committer@example.com
20 GIT_COMMITTER_NAME='C O Mitter'
21 unset GIT_DIFF_OPTS
22 unset GIT_DIR
23 unset GIT_EXTERNAL_DIFF
24 unset GIT_INDEX_FILE
25 unset GIT_OBJECT_DIRECTORY
26 unset SHA1_FILE_DIRECTORIES
27 unset SHA1_FILE_DIRECTORY
28 export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
29 export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
31 for ver in 0.12 0.8; do
32 if [ -e $ver.tar.gz ]; then continue; fi
34 # Get the required stgit version.
36 cd ../..
37 git archive --format=tar --prefix=stgit-$ver/ v$ver
38 ) | tar xf -
40 # Set up a repository.
41 mkdir $ver
42 cd $ver
43 git init
44 touch foo
45 git add foo
46 git commit -m 'Initial commit'
48 # Use the old stgit.
50 pwd
51 PATH=../stgit-$ver:$PATH
53 stg --version
54 stg init
55 echo 'cool branch' > .git/patches/master/description
57 for i in 0 1 2 3 4; do
58 stg new p$i -m "Patch $i"
59 echo "Line $i" >> foo
60 stg refresh
61 done
62 stg pop -n 2
65 # Reduce the number of small files.
66 git gc
68 # Make a tarball.
69 cd ..
70 tar zcf $ver.tar.gz $ver
71 done