Re: [PATCH v4 2/6] commit: add amend suboption to --fixup to create amend! commit
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Mar 14, 2021, 23:07 UTC
- Message-ID
- <CAPig+cTO0umN4nAQi_qZEvTByCHFVavM-KbtfhkukXEUdzLPhg@mail.gmail.com>
- In-Reply-To
- <xmqqblbl4aro.fsf@gitster.g>
On Sun, Mar 14, 2021 at 6:43 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> FWIW I am also fine with Eric's simpler "open code it right there" > suggestion in this case. Just like the "skip alphas" suggestion, it > makes the logic to parse subcommand name out isolated to a single > place without asking readers to refer to the implementation of a > helper, and it would be short enough.
Likewise. If you're going to re-roll anyhow, the open-coded:
char *p = fixup_mesage;
while (isalpha(*p))
p++;
if (p > fixup_message && *p == ':') {
*p = '\0';
fixup_commit = p + 1;would be perfectly fine with me too (or any simple variation on that theme). Whether or not it's worth re-rolling again, I leave up to you and Junio.