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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Narębski <jnareb@xxxxxxxxx> 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@xxxxxxxx>
>>> ---
>>> 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"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]