Re: [PATCH v3 6/6] doc/git-commit: add documentation for fixup=[amend|reword] options

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

 



On Wed, Mar 3, 2021 at 2:44 AM Charvi Mendiratta <charvi077@xxxxxxxxx> wrote:
> On Tue, 2 Mar 2021 at 12:09, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> > On Mon, Mar 1, 2021 at 3:52 AM Charvi Mendiratta <charvi077@xxxxxxxxx> wrote:
> > > Signed-off-by: Charvi Mendiratta <charvi077@xxxxxxxxx>
> > > +       Without `amend:` or `reword:`, create a `fixup!` commit where
> > > +       the commit message will be the subject line from the specified
> > > +       commit with a prefix of "fixup!'". The resulting "fixup!" commit
> > > +       is further used with `git rebase --autosquash` to fixup the
> > > +       content of the specified commit.

By the way, now that you explained in the other thread that "short"
prefix-matching of "amend" and "reword" are allowed, I realize that
the documentation doesn't mention it (or at least I don't remember
reading it).

(Nevertheless, I still feel uncomfortable about supporting short
prefix-matching in the initial implementation without any evidence
that users will demand it, since we can't change that decision once
it's in the hands of users.)

> > > +       When the commit log message begins with "squash! ..." (or "fixup! ..."
> > > +       or "amend! ..."), and there is already a commit in the todo list that
> >
> > Should this also be mentioning `reword!`?
>
> No, as both `amend` and `reword` suboptions create "amend!" commit
> only. I think it seems a bit confusing but I will try another attempt
> to reword the document.

Hmm, I see. So "reword!" is really just an "amend!" with only commit
message but no patch content. That makes perfect sense from an
implementation standpoint, but it makes me wonder if it would be
easier for users to understand if it created a "reword!" commit which
would be recognized as an alias of "amend!". (But maybe that's getting
too confusing, and my musing should be ignored.)

This also answers an unasked question I had regarding the duplicate
"amend! amend!" check. I was wondering why it wasn't also checking for
"reword! reword!".



[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]

  Powered by Linux