Update Dothem to be more quiet
[git] / Doit
1 #!/bin/sh
2
3 : ${J=-j4}
4 force=
5 while   case "$1" in
6         -pedantic) M=$1 ;;
7         -force) force=$1 ;;
8         -dash) with_dash=y ;;
9         -noinstall) install=noinstall ;;
10         *) break ;;
11         esac
12 do
13         shift
14 done
15
16 test -z "$(git diff --cached --name-status)" || {
17         echo >&2 "Repository unclean."
18         exit 1
19 }
20 Meta/Make clean >/dev/null 2>&1
21
22 test -f /bin/dash || with_dash=
23
24 : ${branches='next master maint pu jch'}
25
26 for branch in $branches
27 do
28         echo >&3 "** $branch **"
29
30         revision=$(git show-ref -s --verify "refs/heads/$branch") || {
31                 echo "** No $branch"
32                 continue
33         }
34
35         private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
36         case $? in 0|1) ;; *) exit $? ;; esac
37
38         if      installed=$($HOME/git-$branch/bin/git version) &&
39                 if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
40                 then
41                         :
42                 elif version=v$(expr "$installed" : \
43                                 'git version \(.*\)\.rc[0-9]*$')
44                 then
45                         version="$version"-$(expr "$installed" : \
46                                 'git version .*\.\(rc[0-9]*\)$')
47                 else
48                         version=v$(expr "$installed" : 'git version \(.*\)')
49                 fi &&
50                 version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
51                 test "z$version" = "z$revision"
52         then
53                 echo "* up-to-date version \"$installed\" is already installed from $branch"
54                 test -n "$force" || continue
55         fi
56
57         echo "** $branch" &&
58         git checkout $branch &&
59
60         case "$private" in
61         '')
62                 ;;
63         ?*)
64                 git merge --squash --no-commit "$private" || {
65                         echo >&2 "Cannot apply private edition changes"
66                         git reset --hard
67                 }
68                 ;;
69         esac &&
70
71         Meta/Make $M -- $J clean &&
72         case "$with_dash" in
73         y)
74                 case "$branch" in
75                 master | maint | next | jch)
76                         Meta/Make $M -- $J SHELL_PATH=/bin/dash test &&
77                         Meta/Make $M -- $J clean
78                         ;;
79                 esac
80                 ;;
81         esac &&
82
83         Meta/Make $M -- $J all &&
84         Meta/Make $M -- $J test &&
85         case "$branch" in
86         master | maint | next )
87                 Meta/Make $M -- doc
88                 ;;
89         jch )
90                 Meta/Make $M -- doc install-doc
91                 ;;
92         *)
93                 : ;;
94         esac &&
95         {
96                 test z$install = znoinstall ||
97                 Meta/Make $M -- install
98         } &&
99         Meta/Make clean || exit $?
100
101         git reset --hard
102
103 done >./:all.log 3>&2 2>&1
104
105 git checkout master