Re: [PATCH 2/6] commit: add amend suboption to --fixup to create amend! commit
- From
Charvi Mendiratta <charvi077@gmail.com>
- Date
- Feb 19, 2021, 06:10 UTC
- Message-ID
- <CAPSFM5dL073pO4mDN=4ca-McFq3za09-J5hjSOpmeUkAMQseNA@mail.gmail.com>
- In-Reply-To
- <xmqqpn0xdse8.fsf@gitster.g>
On Fri, 19 Feb 2021 at 02:07, Junio C Hamano <gitster@pobox.com> wrote:
Show 26 quoted lines
> > Junio C Hamano <gitster@pobox.com> writes: > > >> ...Thanks, for pointing this out. Also, in the above method for > >> alnum I think we can initialize an array of alnum[] instead of > >> alphas[]. Or otherwise I was thinking to instead check: > >> if (!isalnum(*c) && *c == ':') > > > > Sure a loop is fine, or alnum[] is fine, or just alpha[] is OK, I > > would think. Do you foresee you'd need --fixup=chomp124:<commit>? > > I somehow doubt it. > > Having said that, we may regret if we did not include some > punctuation to allow for a multi-word keyword. IOW, "alpha plus > dash" might be a reasonable minimum. > > But what keyword --fixup=<keyword>:<commit> can take is entirely > under our control, so it is not all that unreasonable if we just > forced our developers some discipline to pick a single-word keyword > for any of their future enhancements. It's not like we are opening > up extensibility to the end-users, who may complain that the way > they can spell their new <keyword> is too limited. So if we already > have alpha[] and/or a helper function that does strspn(alpha) that > we can reuse elsewhere, I do not think it is worth to try supporting > punctuation. >
Oh, yes punctuation is another point. Then for now maybe we can just make the helper function to check for alpha[] only.
Thanks and Regards, Charvi