Re: [PATCH] rebase--interactive: count squash commits above 10 correctly
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 8, 2017, 03:26 UTC
- Message-ID
- <xmqqlgum1bbt.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170107082318.jj3izthx2ylscrns@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> git-rebase--interactive.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index b0a6f2b7ba..4734094a3f 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -425,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" \I would have written it to match ".*[^1-9]\([1-9][0-9]*\)", though. Even if a foreign language expresses all its words as digits (or has a digit as the last letter of the last word before the number), a translation into it must have a non-digit before the number to disambiguate---but I guess I am being ultra-pedantic, and I think what you wrote would be sufficient in practice.
As you guys discussed, this code will hopefully disappear in a cycle or two anyway ;-) Let's queue this as-is.
Thanks.
> -e "q" < "$squash_msg".bak)+1))
> {
> printf '%s\n' "$comment_char $(eval_ngettext \