What's cooking/in 2008 Sep #2
[git/spearce.git] / Doit
blobf29d051b83a4e708eb8ac5d03d67522cb190bc87
1 #!/bin/sh
3 : ${J=-j4}
4 force=
5 while case "$1" in
6 -pedantic) M=$1 ;;
7 -force) force=$1 ;;
8 *) break ;;
9 esac
11 shift
12 done
14 test -z "$(git diff --cached --name-status)" || {
15 echo >&2 "Repository unclean."
16 exit 1
18 Meta/Make clean >/dev/null 2>&1
20 : ${branches='next master maint pu jch'}
22 for branch in $branches
24 echo >&3 "** $branch **"
26 revision=$(git show-ref -s --verify "refs/heads/$branch") || {
27 echo "** No $branch"
28 continue
31 if installed=$($HOME/git-$branch/bin/git version) &&
32 if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
33 then
35 elif version=v$(expr "$installed" : \
36 'git version \(.*\)\.rc[0-9]*$')
37 then
38 version="$version"-$(expr "$installed" : \
39 'git version .*\.\(rc[0-9]*\)$')
40 else
41 version=v$(expr "$installed" : 'git version \(.*\)')
42 fi &&
43 version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
44 test "z$version" = "z$revision"
45 then
46 echo "* up-to-date version \"$installed\" is already installed from $branch"
47 test -n "$force" || continue
50 echo "** $branch" &&
51 git checkout $branch &&
52 Meta/Make $M -- $J all &&
53 Meta/Make $M -- $J test &&
54 Meta/Make $M -- install &&
55 case "$branch" in
56 master | maint | next )
57 Meta/Make $M -- doc
59 jch )
60 Meta/Make $M -- doc install-doc
63 : ;;
64 esac &&
65 Meta/Make clean || exit $?
67 done >./:all.log 3>&2 2>&1
69 git checkout master