Re: [PATCH v3 6/6] doc/git-commit: add documentation for fixup=[amend|reword] options
- From
Charvi Mendiratta <charvi077@gmail.com>
- Date
- Mar 3, 2021, 19:22 UTC
- Message-ID
- <CAPSFM5eF1c5--8nqiDQ0ZLwz7cnNxx_BahPHGCvqbnrYKkCf9A@mail.gmail.com>
- In-Reply-To
- <CAPig+cRiiQyavaMGzgBkXOoGFPhMBC7GbpB61ziFMrckReFbcQ@mail.gmail.com>
On Wed, 3 Mar 2021 at 13:48, Eric Sunshine <sunshine@sunshineco.com> wrote:
>
[...]
Show 5 quoted lines
> 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). >
Yes, I admit it was not included. I will add it too.
Show 5 quoted lines
> (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.) >
I am not sure about strong evidence but I tried to keep the major points discussed earlier, as mentioned in the previous thread. Also I think otherwise the short prefix will ease out / shorten the command to prepare the "amend!" and also mirrors the commands in interactive rebase.
Show 16 quoted lines
> > > > + 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.) >
Yes, we didn't choose to make "reword!" commit because if we do so then again it would be expected to implicitly change 'pick' command to 'reword' in sequencer/ rebase to-do list when combined with 'git rebase -- autosquash'. But here we are changing 'pick' to ' fixup -C' to fulfill the working. So, we decided to create a variant of '--fixup' and serve it as "amend!" commit.
> 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!".
Yes, it's true.
Thanks for the reveiws, I will add the above mentioned changes too.
Thanks and Regards, Charvi