What's cooking 2009-01 issue #1
[git/spearce.git] / Doit
blob5a8645166879bcb74e3b7b619c3bacd804817265
1 #!/bin/sh
3 : ${J=-j4}
4 force=
5 while case "$1" in
6 -pedantic) M=$1 ;;
7 -force) force=$1 ;;
8 -dash) with_dash=y ;;
9 *) break ;;
10 esac
12 shift
13 done
15 test -z "$(git diff --cached --name-status)" || {
16 echo >&2 "Repository unclean."
17 exit 1
19 Meta/Make clean >/dev/null 2>&1
21 test -f /bin/dash || with_dash=
23 : ${branches='next master maint pu jch'}
25 for branch in $branches
27 echo >&3 "** $branch **"
29 revision=$(git show-ref -s --verify "refs/heads/$branch") || {
30 echo "** No $branch"
31 continue
34 if installed=$($HOME/git-$branch/bin/git version) &&
35 if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
36 then
38 elif version=v$(expr "$installed" : \
39 'git version \(.*\)\.rc[0-9]*$')
40 then
41 version="$version"-$(expr "$installed" : \
42 'git version .*\.\(rc[0-9]*\)$')
43 else
44 version=v$(expr "$installed" : 'git version \(.*\)')
45 fi &&
46 version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
47 test "z$version" = "z$revision"
48 then
49 echo "* up-to-date version \"$installed\" is already installed from $branch"
50 test -n "$force" || continue
53 echo "** $branch" &&
54 git checkout $branch &&
55 Meta/Make $M -- $J clean &&
56 case "$with_dash" in
58 case "$branch" in
59 master | maint | next | jch)
60 Meta/Make $M -- $J SHELL_PATH=/bin/dash test &&
61 Meta/Make $M -- $J clean
63 esac
65 esac &&
66 Meta/Make $M -- $J all &&
67 Meta/Make $M -- $J test &&
68 case "$branch" in
69 master | maint | next )
70 Meta/Make $M -- doc
72 jch )
73 Meta/Make $M -- doc install-doc
76 : ;;
77 esac &&
78 Meta/Make $M -- install &&
79 Meta/Make clean || exit $?
81 done >./:all.log 3>&2 2>&1
83 git checkout master