Re: [PATCH 18/22] sequencer: support amending commits
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 1, 2016, 13:42 UTC
- Message-ID
- <alpine.DEB.2.20.1609011540550.129229@virtualbox>
- In-Reply-To
- <dd7e4c82-cedb-6cde-a186-8b52bac3a5b8@gmail.com>
Hi Kuba,
On Wed, 31 Aug 2016, Jakub Narębski wrote:
Show 15 quoted lines
> W dniu 29.08.2016 o 10:06, Johannes Schindelin pisze: > > > diff --git a/sequencer.c b/sequencer.c > > index 7e17d14..20f7590 100644 > > --- a/sequencer.c > > +++ b/sequencer.c > > @@ -478,7 +478,7 @@ static char **read_author_script(void) > > * (except, of course, while running an interactive rebase). > > */ > > int sequencer_commit(const char *defmsg, struct replay_opts *opts, > > - int allow_empty, int edit) > > + int allow_empty, int edit, int amend) > > I guess we won't get much more parameters; it would get unwieldy > (and hard to remember). Five is all right.
It will eventually get a sixth, cleanup_commit_message.
Show 21 quoted lines
> > {
> > char **env = NULL;
> > struct argv_array array;
> > @@ -507,6 +507,8 @@ int sequencer_commit(const char *defmsg, struct replay_opts *opts,
> > argv_array_push(&array, "commit");
> > argv_array_push(&array, "-n");
> >
> > + if (amend)
> > + argv_array_push(&array, "--amend");
> > if (opts->gpg_sign)
> > argv_array_pushf(&array, "-S%s", opts->gpg_sign);
> > if (opts->signoff)
> > @@ -779,7 +781,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
> > }
> > if (!opts->no_commit)
> > res = sequencer_commit(opts->edit ? NULL : git_path_merge_msg(),
> > - opts, allow, opts->edit);
> > + opts, allow, opts->edit, 0);
>
> ... even of this makes one need to check the calling convention,
> what does this 0 mean.Yeah, but it will not remain "0", but be replaced by a variable named "amend"...
Thanks for the review, Dscho