Merge branch 'jk/rebase-i-squash-count-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 31 Jan 2017 21:32:07 +0000 (13:32 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 Jan 2017 21:32:07 +0000 (13:32 -0800)
"git rebase -i" with a recent update started showing an incorrect
count when squashing more than 10 commits.

* jk/rebase-i-squash-count-fix:
rebase--interactive: count squash commits above 10 correctly

1  2 
git-rebase--interactive.sh
index 41fd374c725de1f42965b829c2bed5c48c92e19c,4bca73c94cc9688a855220909ed3b98f53c4d481..f5f58c483a5e229a6b62df6042fe42fb9d9de105
@@@ -93,17 -93,8 +93,17 @@@ eval 
  GIT_CHERRY_PICK_HELP="$resolvemsg"
  export GIT_CHERRY_PICK_HELP
  
 -comment_char=$(git config --get core.commentchar 2>/dev/null | cut -c1)
 -: ${comment_char:=#}
 +comment_char=$(git config --get core.commentchar 2>/dev/null)
 +case "$comment_char" in
 +'' | auto)
 +      comment_char="#"
 +      ;;
 +?)
 +      ;;
 +*)
 +      comment_char=$(echo "$comment_char" | cut -c1)
 +      ;;
 +esac
  
  warn () {
        printf '%s\n' "$*" >&2
@@@ -425,7 -416,7 +425,7 @@@ update_squash_messages () 
        if test -f "$squash_msg"; then
                mv "$squash_msg" "$squash_msg".bak || exit
                count=$(($(sed -n \
-                       -e "1s/^$comment_char.*\([0-9][0-9]*\).*/\1/p" \
+                       -e "1s/^$comment_char[^0-9]*\([0-9][0-9]*\).*/\1/p" \
                        -e "q" < "$squash_msg".bak)+1))
                {
                        printf '%s\n' "$comment_char $(eval_ngettext \