Code

[PATCH] Do not rely on a sane wc
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Mon, 1 Aug 2005 14:32:37 +0000 (16:32 +0200)
committerJunio C Hamano <junkio@cox.net>
Mon, 1 Aug 2005 20:27:09 +0000 (13:27 -0700)
Some implementations of wc pad the line number with white space, which
expr does not grok as a number.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-format-patch-script

index 994019e17ef5e6fa6c5a7da3c69656be4c445cdf..51e8af0acb76679d712884f990a6363cfd235d7e 100755 (executable)
@@ -109,7 +109,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 stripCommitHead='/^'"$_x40"' (from '"$_x40"')$/d'
 
 git-rev-list --merge-order "$junio" "^$linus" >$series
-total=`wc -l <$series`
+total=`wc -l <$series | tr -dc "[0-9]"`
 i=$total
 while read commit
 do