summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eea4206)
raw | patch | inline | side by side (parent: eea4206)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 11 Dec 2005 06:22:35 +0000 (22:22 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 11 Dec 2005 06:22:35 +0000 (22:22 -0800) |
This would help sorting by subject in MUA work saner even though
MUA is too dumb to attempt sorting numbered subjects sanely.
Signed-off-by: Junio C Hamano <junkio@cox.net>
MUA is too dumb to attempt sorting numbered subjects sanely.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-format-patch.sh | patch | blob | history |
diff --git a/git-format-patch.sh b/git-format-patch.sh
index 1eebe857c021495b92d9e39ec1193b85ab4e980e..921feee59cd7e770328fc1d167e01730a238489e 100755 (executable)
--- a/git-format-patch.sh
+++ b/git-format-patch.sh
}
total=`wc -l <$series | tr -dc "[0-9]"`
+case "$total,$numbered" in
+1,*)
+ numfmt='' ;;
+*,t)
+ numfmt=`echo "$total" | wc -c`
+ numfmt=$(($numfmt-1))
+ numfmt=" %0${numfmt}d/$total"
+esac
+
i=1
while read commit
do
case "$numbered" in
'') num= ;;
*)
- case $total in
- 1) num= ;;
- *) num=' '`printf "%d/%d" $i $total` ;;
- esac
+ num=`printf "$numfmt" $i` ;;
esac
file=`printf '%04d-%stxt' $i "$title"`