From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Sebastian Schuberth <sschuberth@gmail.com>
Subject: Re: [PATCH v2 2/3] sequencer: make commit options more extensible
Date: Sat, 25 Mar 2017 01:01:55 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1703250100340.3767@virtualbox> (raw)
In-Reply-To: <xmqq7f3fa3oz.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Thu, 23 Mar 2017, Junio C Hamano wrote:
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
> > @@ -926,14 +930,14 @@ static void record_in_rewritten(struct object_id *oid,
> > static int do_pick_commit(enum todo_command command, struct commit *commit,
> > struct replay_opts *opts, int final_fixup)
> > {
> > - int edit = opts->edit, cleanup_commit_message = 0;
> > - const char *msg_file = edit ? NULL : git_path_merge_msg();
> > + unsigned int flags = opts->edit ? EDIT_MSG : 0, allow = 0;
> > + const char *msg_file = opts->edit ? NULL : git_path_merge_msg();
> > unsigned char head[20];
> > struct commit *base, *next, *parent;
> > const char *base_label, *next_label;
> > struct commit_message msg = { NULL, NULL, NULL, NULL };
> > struct strbuf msgbuf = STRBUF_INIT;
> > - int res, unborn = 0, amend = 0, allow = 0;
> > + int res, unborn = 0;
> > ...
> > @@ -1123,11 +1127,11 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
> > if (allow < 0) {
> > res = allow;
> > goto leave;
> > - }
> > + } else if (allow)
> > + flags |= ALLOW_EMPTY;
>
> Making "flags" unsigned was a correct change, but this is now wrong,
> as "allow" is made unsigned by accident.
Right. Bummer.
> Perhaps something like this needs to be squashed in?
>
> sequencer.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index bc2fe48e65..6c423566e6 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -932,14 +932,14 @@ static void record_in_rewritten(struct object_id *oid,
> static int do_pick_commit(enum todo_command command, struct commit *commit,
> struct replay_opts *opts, int final_fixup)
> {
> - unsigned int flags = opts->edit ? EDIT_MSG : 0, allow = 0;
> + unsigned int flags = opts->edit ? EDIT_MSG : 0;
> const char *msg_file = opts->edit ? NULL : git_path_merge_msg();
> unsigned char head[20];
> struct commit *base, *next, *parent;
> const char *base_label, *next_label;
> struct commit_message msg = { NULL, NULL, NULL, NULL };
> struct strbuf msgbuf = STRBUF_INIT;
> - int res, unborn = 0;
> + int allow, res, unborn = 0;
I had originally moved it from there, to stay with the related flags, but
I should just have left it there.
Your patch looks good, you could do even better by reverting that move
(IIRC it was at the end of the line, and it was set to 0 by default).
Ciao,
Dscho
next prev parent reply other threads:[~2017-03-25 0:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 15:01 [PATCH 0/3] rebase -i (reword): call the commit-msg hook again Johannes Schindelin
2017-03-22 15:01 ` [PATCH 1/3] t7504: document regression: reword no longer calls commit-msg Johannes Schindelin
2017-03-22 15:18 ` Sebastian Schuberth
2017-03-22 16:09 ` Johannes Schindelin
2017-03-22 18:15 ` Junio C Hamano
2017-03-23 14:43 ` Johannes Schindelin
2017-03-23 14:55 ` Sebastian Schuberth
2017-03-23 15:52 ` Johannes Schindelin
2017-03-22 18:12 ` Junio C Hamano
2017-03-23 14:41 ` Johannes Schindelin
2017-03-22 15:01 ` [PATCH 2/3] sequencer: make commit options more extensible Johannes Schindelin
2017-03-22 18:21 ` Junio C Hamano
2017-03-23 14:39 ` Johannes Schindelin
2017-03-23 16:04 ` Junio C Hamano
2017-03-22 15:02 ` [PATCH 3/3] sequencer: allow the commit-msg hooks to run during a `reword` Johannes Schindelin
2017-03-22 18:43 ` Junio C Hamano
2017-03-23 15:49 ` Johannes Schindelin
2017-03-23 16:07 ` [PATCH v2 0/3] rebase -i (reword): call the commit-msg hook again Johannes Schindelin
2017-03-23 16:07 ` [PATCH v2 1/3] t7504: document regression: reword no longer calls commit-msg Johannes Schindelin
2017-03-23 16:07 ` [PATCH v2 2/3] sequencer: make commit options more extensible Johannes Schindelin
2017-03-24 1:01 ` Junio C Hamano
2017-03-25 0:01 ` Johannes Schindelin [this message]
2017-03-27 0:55 ` Junio C Hamano
2017-03-27 21:03 ` Junio C Hamano
2017-03-29 12:49 ` Johannes Schindelin
2017-03-23 16:07 ` [PATCH v2 3/3] sequencer: allow the commit-msg hooks to run during a `reword` Johannes Schindelin
2017-03-23 16:51 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1703250100340.3767@virtualbox \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sschuberth@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).