Meta/Doit: avoid rebuilding already up-to-date branches.
Junio C Hamano committed
Apr 3, 2007 at 01:08 UTC
3b798f2f56b18ea939c458d015d97563597adb05
1 file changed
+19
-9
Doit
+19
-9
@@ -17,17 +17,27 @@ Meta/Make clean >/dev/null 2>&1
17
nstall=install
18
for branch in $branches
19
do
20
- if git rev-parse --verify refs/heads/$branch 2>/dev/null
21
- then
22
- echo "** $branch" &&
23
- git checkout $branch &&
24
- Meta/Make $M -- $J all &&
25
- Meta/Make $M -- $J $nstall &&
26
- Meta/Make $M -- test &&
27
- Meta/Make clean || exit $?
28
- else
20
+ revision=$(git show-ref -s --verify "refs/heads/$branch") || {
21
echo "** No $branch"
22
+ continue
23
+ }
24
+
25
+ if installed=$($HOME/git-$branch/bin/git version) &&
26
+ version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$') &&
27
+ version=$(git rev-parse --verify "$version") &&
28
+ test "z$version" = "z$revision"
29
+ then
30
+ echo "* up-to-date version \"$installed\" is already installed from $branch"
31
+ continue
32
fi
33
+
34
+ echo "** $branch" &&
35
+ git checkout $branch &&
36
+ Meta/Make $M -- $J all &&
37
+ Meta/Make $M -- $J $nstall &&
38
+ Meta/Make $M -- test &&
39
+ Meta/Make clean || exit $?
40
+
41
done >./:all.log 2>&1
42
43
git checkout master