Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Brandon Tolsch <btolsch@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Vasco Almeida <vascomalmeida@sapo.pt>,
	git@vger.kernel.org
Subject: Re: [PATCH] rebase--interactive: count squash commits above 10 correctly
Date: Sat, 07 Jan 2017 19:26:30 -0800	[thread overview]
Message-ID: <xmqqlgum1bbt.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170107082318.jj3izthx2ylscrns@sigill.intra.peff.net> (Jeff King's message of "Sat, 7 Jan 2017 03:23:19 -0500")

Jeff King <peff@peff.net> writes:

>  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 \

      parent reply	other threads:[~2017-01-08  3:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06  9:04 Squashing commits with git rebase -i may miscount commits in commit message Brandon Tolsch
2017-01-06 13:46 ` Johannes Schindelin
2017-01-07  8:23 ` [PATCH] rebase--interactive: count squash commits above 10 correctly Jeff King
2017-01-07 10:51   ` Johannes Schindelin
2017-01-07 11:05     ` Jeff King
2017-01-08  3:26   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqlgum1bbt.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=btolsch@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=vascomalmeida@sapo.pt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox