Charvi Mendiratta <charvi077@xxxxxxxxx> writes: > `git commit --fixup=reword:<commit>` creates an empty "amend!" commit > that will reword <commit> without changing its contents when it is > rebased with --autosquash. > > Apart from ignoring staged changes it works similarly to > `--fixup=amend:<commit>`. > > Mentored-by: Christian Couder <chriscool@xxxxxxxxxxxxx> > Mentored-by: Phillip Wood <phillip.wood@xxxxxxxxxxxxx> > Helped-by: Junio C Hamano <gitster@xxxxxxxxx> > Signed-off-by: Charvi Mendiratta <charvi077@xxxxxxxxx> > --- > builtin/commit.c | 44 ++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 36 insertions(+), 8 deletions(-) > > diff --git a/builtin/commit.c b/builtin/commit.c > index 200ef83cc0..a4d18d96df 100644 > --- a/builtin/commit.c > +++ b/builtin/commit.c > @@ -1186,6 +1186,27 @@ static void finalize_deferred_config(struct wt_status *s) > s->ahead_behind_flags = AHEAD_BEHIND_FULL; > } > > +static void check_fixup_reword_options(int argc, const char *argv[]) { > + if (whence != FROM_COMMIT) { > + if (whence == FROM_MERGE) > + die(_("You are in the middle of a merge -- cannot reword.")); > + else if (is_from_cherry_pick(whence)) > + die(_("You are in the middle of a cherry-pick -- cannot reword.")); > + } > + if (argc) > + die(_("cannot combine reword option of --fixup with path %s"), *argv); I think our convention is to quote '%s' with a single-quote pair. See other error messages. commit.c: die_errno(_("could not read '%s'"), templat... commit.c: die_errno(_("could not open '%s'"), git_path_commit... commit.c: die(_("--author '%s' is not 'Name <email>' and matches no e... commit.c: die(_("Invalid ignored mode '%s'"), ignored_arg); commit.c: die(_("Invalid untracked files mode '%s'"), untrack... ...