From: Junio C Hamano <gitster@pobox.com>
To: "Jakub Narębski" <jnareb@gmail.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
Johannes Sixt <j6t@kdbg.org>,
Vasco Almeida <vascomalmeida@sapo.pt>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH va/i18n-even-more] rebase-interactive: trim leading whitespace from progress count
Date: Thu, 28 Jul 2016 13:30:13 -0700 [thread overview]
Message-ID: <xmqqpopxqze2.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <579A52BD.8050009@gmail.com> ("Jakub Narębski"'s message of "Thu, 28 Jul 2016 20:45:17 +0200")
Jakub Narębski <jnareb@gmail.com> writes:
> On the gripping hand, the number of currently processed commits
> (instructions) in an interactive rebase is a number, and arithmetic
> expansion can be understood as shell equivalent of casting to integer.
I get that argument; it is a bit too cute a justification for my
taste, but the resulting code is consistent with how $total loses
the potential leading whitespace, so I'll queue it as-is.
Thanks.
>
>>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>>> ---
>>> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
>>> @@ -121,7 +121,7 @@ mark_action_done () {
>>> sed -e 1q < "$todo" >> "$done"
>>> sed -e 1d < "$todo" >> "$todo".new
>>> mv -f "$todo".new "$todo"
>>> - new_count=$(git stripspace --strip-comments <"$done" | wc -l)
>>> + new_count=$(( $(git stripspace --strip-comments <"$done" | wc -l) ))
>>> echo $new_count >"$msgnum"
>>> total=$(($new_count + $(git stripspace --strip-comments <"$todo" | wc -l)))
>>> echo $total >"$end"
prev parent reply other threads:[~2016-07-28 20:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 17:47 [PATCH va/i18n-even-more] rebase-interactive: trim leading whitespace from progress count Johannes Sixt
2016-07-28 18:22 ` Eric Sunshine
2016-07-28 18:45 ` Jakub Narębski
2016-07-28 20:30 ` 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=xmqqpopxqze2.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=jnareb@gmail.com \
--cc=sunshine@sunshineco.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.