From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Phillip Wood <phillip.wood@dunelm.org.uk>
Cc: Alban Gruin <alban.gruin@gmail.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v1 4/5] rebase: fill `squash_onto' in get_replay_opts()
Date: Wed, 2 Oct 2019 10:16:52 +0200 (CEST) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1910021011010.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <66fcd66b-fad2-e5a1-cdd8-fd7b37c4abbf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]
Hi,
On Fri, 27 Sep 2019, Phillip Wood wrote:
> Hi Alban
>
> On 25/09/2019 21:13, Alban Gruin wrote:
> > get_replay_opts() did not fill `squash_onto' if possible, meaning that
>
> I'm not sure what you mean by 'if possible' here, I think the sentance makes
> sense without that.
>
> > this field should be read from the disk by the sequencer through
> > read_populate_opts(). Without this, calling `pick_commits()' directly
> > will result in incorrect results with `rebase --root'.
I guess I would have an easier time reading the commit message if this
paragraph read like this:
The `get_replay_opts()` function currently does not initialize
the `squash_onto` field (which is used for the `--root` mode),
only `read_populate_opts()` does.
That would lead to incorrect results when calling
`pick_commits()` without reading the options from disk first.
> >
> > Let’s change that.
>
> Good catch
>
> Best Wishes
>
> Phillip
>
> > Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
> > ---
> > builtin/rebase.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/builtin/rebase.c b/builtin/rebase.c
> > index e8319d5946..2097d41edc 100644
> > --- a/builtin/rebase.c
> > +++ b/builtin/rebase.c
> > @@ -117,6 +117,11 @@ static struct replay_opts get_replay_opts(const struct
> > rebase_options *opts)
> > if (opts->strategy_opts)
> > parse_strategy_opts(&replay, opts->strategy_opts);
> > + if (opts->squash_onto) {
I guess it does not matter much, but shouldn't this be guarded against
the case where `replay.squash_onto` was already initialized? Like, `if
(opts->squash_onto && !replay.have_squash_onto)`?
Other than that, this patch makes sense to me.
Ciao,
Dscho
> > + oidcpy(&replay.squash_onto, opts->squash_onto);
> > + replay.have_squash_onto = 1;
> > + }
> > +
> > return replay;
> > }
> >
> >
>
>
next prev parent reply other threads:[~2019-10-02 8:17 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190925201315.19722-1-alban.gruin@gmail.com>
2019-09-25 20:13 ` [PATCH v1 1/5] sequencer: update `total_nr' when adding an item to a todo list Alban Gruin
2019-10-02 2:10 ` Junio C Hamano
2019-10-02 8:06 ` Johannes Schindelin
2019-10-02 8:59 ` Junio C Hamano
2019-10-02 9:48 ` Johannes Schindelin
2019-10-02 18:03 ` Alban Gruin
2019-09-25 20:13 ` [PATCH v1 2/5] sequencer: update `done_nr' when skipping commands in " Alban Gruin
2019-09-25 20:13 ` [PATCH v1 3/5] sequencer: move the code writing total_nr on the disk to a new function Alban Gruin
2019-09-25 20:13 ` [PATCH v1 4/5] rebase: fill `squash_onto' in get_replay_opts() Alban Gruin
2019-09-27 13:30 ` Phillip Wood
2019-10-02 8:16 ` Johannes Schindelin [this message]
2019-10-02 9:32 ` Phillip Wood
2019-10-02 12:06 ` Johannes Schindelin
2019-09-25 20:13 ` [PATCH v1 5/5] sequencer: directly call pick_commits() from complete_action() Alban Gruin
2019-09-27 13:26 ` Phillip Wood
2019-10-02 8:20 ` Johannes Schindelin
2019-10-02 18:03 ` Alban Gruin
2019-10-02 2:38 ` Junio C Hamano
2019-10-02 18:37 ` Alban Gruin
2019-10-26 7:47 ` René Scharfe
2019-10-26 11:27 ` Alban Gruin
2019-10-28 1:39 ` Junio C Hamano
2019-10-28 3:20 ` Junio C Hamano
2019-09-25 20:20 ` [PATCH v1 0/5] Use complete_action's todo list to do the rebase Alban Gruin
2019-09-27 13:32 ` [PATCH v1 0/5] Use complete_action’s " Phillip Wood
2019-10-07 9:26 ` [PATCH v2 0/5] Use complete_action's " Alban Gruin
2019-10-07 9:26 ` [PATCH v2 1/5] sequencer: update `total_nr' when adding an item to a todo list Alban Gruin
2019-10-07 9:26 ` [PATCH v2 2/5] sequencer: update `done_nr' when skipping commands in " Alban Gruin
2019-10-07 9:26 ` [PATCH v2 3/5] sequencer: move the code writing total_nr on the disk to a new function Alban Gruin
2019-10-07 9:26 ` [PATCH v2 4/5] rebase: fill `squash_onto' in get_replay_opts() Alban Gruin
2019-10-07 9:26 ` [PATCH v2 5/5] sequencer: directly call pick_commits() from complete_action() Alban Gruin
2019-10-08 2:45 ` [PATCH v2 0/5] Use complete_action's todo list to do the rebase Junio C Hamano
2019-10-08 16:18 ` Alban Gruin
2019-10-14 12:49 ` Johannes Schindelin
2019-11-23 14:37 ` [PATCH v3 " Alban Gruin
2019-11-23 14:37 ` [PATCH v3 1/5] sequencer: update `total_nr' when adding an item to a todo list Alban Gruin
2019-11-23 14:37 ` [PATCH v3 2/5] sequencer: update `done_nr' when skipping commands in " Alban Gruin
2019-11-23 14:37 ` [PATCH v3 3/5] sequencer: move the code writing total_nr on the disk to a new function Alban Gruin
2019-11-23 14:37 ` [PATCH v3 4/5] rebase: fill `squash_onto' in get_replay_opts() Alban Gruin
2019-11-23 14:37 ` [PATCH v3 5/5] sequencer: directly call pick_commits() from complete_action() Alban Gruin
2019-11-24 17:43 ` [PATCH v4 0/5] Use complete_action's todo list to do the rebase Alban Gruin
2019-11-24 17:43 ` [PATCH v4 1/5] sequencer: update `total_nr' when adding an item to a todo list Alban Gruin
2019-11-24 17:43 ` [PATCH v4 2/5] sequencer: update `done_nr' when skipping commands in " Alban Gruin
2019-11-24 17:43 ` [PATCH v4 3/5] sequencer: move the code writing total_nr on the disk to a new function Alban Gruin
2019-11-24 17:43 ` [PATCH v4 4/5] rebase: fill `squash_onto' in get_replay_opts() Alban Gruin
2019-11-26 18:27 ` Jonathan Tan
2019-11-24 17:43 ` [PATCH v4 5/5] sequencer: directly call pick_commits() from complete_action() Alban Gruin
2019-11-26 18:41 ` Jonathan Tan
2019-11-27 19:56 ` Alban Gruin
2019-11-27 20:09 ` Alban Gruin
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.QRO.7.76.6.1910021011010.46@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=alban.gruin@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).