From: Junio C Hamano Date: Thu, 18 Feb 2021 19:18:59 GMT Subject: Re: [PATCH 2/6] commit: add amend suboption to --fixup to create amend! commit Message-ID: In-Reply-To: Charvi Mendiratta writes: > Hi Junio, > > On Thu, 18 Feb 2021 at 01:20, Junio C Hamano wrote: > [...] >> The second one, even with s|HEAD|HEAD~3| is even less clear. >> Without the "-m", the resulting commit will have the subject that >> begins with !amend but the log message body is taken from the given >> commit, but with "-m", what happens? Does a single-liner 'clever >> commit message' _replace_ the log message of the named commit, >> resulting in an !amend commit that has no message from the original? >> Or does 'clever commit message' get _appended_ the log message? >> > > Yes, here it gets _appended_ the log message. I agree this seems a bit > confusing. In what situation would a user use "-m 'appended pieces of text'" option, together with "--fixup=amend:"? I am wondering if we want such a "append to" feature, or is it easier to understand for end-users if "-m", "-F", "-C" and "-c" (the common trait of these options is that they contribute to the log message text) are made incompatible with --fixup=amend:. > ...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:? I somehow doubt it.