git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH va/i18n-even-more] rebase-interactive: trim leading whitespace from progress count

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2016, 20:30 UTC
Message-ID
<xmqqpopxqze2.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<579A52BD.8050009@gmail.com>
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.
Show 13 quoted lines
>
>>> 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"
Previous: Jakub Narębski
Message 4 of 4 in “rebase-interactive: trim leading whitespace from progress count”
  1. rebase-interactive: trim leading whitespace from progress countJohannes Sixt, Jul 28, 2016
  2. Eric SunshineJul 28, 2016
  3. Jakub NarębskiJul 28, 2016
  4. Junio C HamanoJul 28, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.