Re: [PATCH v4 3/6] commit: add a reword suboption to --fixup
- From
Charvi Mendiratta <charvi077@gmail.com>
- Date
- Mar 11, 2021, 04:01 UTC
- Message-ID
- <CAPSFM5dqRbuoCvEFcHQPSQt+EK1_pBVQ--f42jR+GNqCFd_SOg@mail.gmail.com>
- In-Reply-To
- <xmqqpn06h6os.fsf@gitster.g>
On Thu, 11 Mar 2021 at 06:01, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
>
> Charvi Mendiratta <charvi077@gmail.com> writes:
>
> > * reference for example: --fixup="HEAD^{/^area: string}" or
> > * a suboption of `--fixup`.
> > *
> > - * As `amend` suboption contains only alpha character.
> > - * So check if first non alpha character in fixup_message
> > - * is ':'.
> > + * As `amend`/`reword` suboptions contains only alpha
> > + * characters. So check if first non alpha character
> > + * in fixup_message is ':'.
>
> Sorry, but I cannot quite follow the logic.
>
> We limit --fixup's suboptions to only alpha characters. If
> the first character after a len of alpha is colon, then the
> part before the colon may be a known suboption name like
> `amend` or `reword`, or a misspelt suboption name.
>
> Otherwise, we are dealing with --fixup=<commit> that happens
> to have a colon in <commit> object name.
>
> perhaps?Yes, Agree. Here I just intend to mention the special case "--fixup=HEAD^{/^area: string}" because of which we chose the method to check if first non alpha char is ':' instead of directly checking the suboption like (skip_prefix(msg, "amend:", &arg). So maybe we can reword it like
- To check if fixup_message that contains ':' is a commit
- reference for example: --fixup="HEAD^{/^area: string}" or
- a suboption of `--fixup`.
+ fixup_message could be a commit reference for example:
+ --fixup="HEAD^{/^area:string}" or a suboption of `--fixup`.
+
+ As `amend` ...Thanks and Regards, Charvi