From: Charvi Mendiratta Date: Thu, 04 Mar 2021 09:00:34 GMT Subject: Re: [PATCH v3 6/6] doc/git-commit: add documentation for fixup=[amend|reword] options Message-ID: In-Reply-To: On Thu, 4 Mar 2021 at 06:35, Junio C Hamano wrote: > > Eric Sunshine writes: > > > 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.) > > Perhaps related, perhaps not, but I wonder if we really need --fixup=amend > and --fixup=reword to begin with. The "amend" variant, > > $ git commit --fixup=amend: ... other args ... > > is about shaping the index with "other args" and recording the > resulting tree with the log message taken from , marked > with the "amend!" prefix. The --fixup=reword: variant > is a mere special case of it where the recorded tree is made of the > index in the same way as a partial commit with pathspec that matches > no paths, i.e. If you have --fixup=amend, you can do > > $ git commit --fixup=amend: --only > > and you do not need --fixup=reword: at all, no? > Maybe as an alternative User interface, we can remove the `--fixup=reword:`. But for this patch, as we have kept separate suboption `--fixup=reword:` , so if now we do `--fixup=amend: --only` then it will return the error as below : fatal: No paths with --include/--only does not make sense. So, `amend` works only if staged changes are present otherwise to change only the commit message `reword` option is there. I agree we can change to the above UI but still I wonder which one is more friendly ? Also, I think we need to add complete `--allow-empty --only` to mirror the working of `reword` so this may result in a lot of typing and hard to remember. Thanks and Regards, Charvi