Re: [PATCH 1/3] rebase: introduce --reschedule-failed-exec
- From
Elijah Newren <newren@gmail.com>
- Date
- Dec 11, 2018, 16:16 UTC
- Message-ID
- <CABPp-BHENhW=uz6=_gzELNOd15JWfH1ymtxVRFMD284FLBFtKg@mail.gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1812111104561.43@tvgsbejvaqbjf.bet>
Hi Dscho,
On Tue, Dec 11, 2018 at 2:14 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 32 quoted lines
>
> Hi Elijah,
>
> On Mon, 10 Dec 2018, Elijah Newren wrote:
>
> > On Mon, Dec 10, 2018 at 1:18 PM Johannes Schindelin via GitGitGadget
> > <gitgitgadget@gmail.com> wrote:
> > >
> > > @@ -1195,6 +1201,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> > > break;
> > > }
> > >
> > > + if (options.reschedule_failed_exec && !is_interactive(&options))
> > > + die(_("--reschedule-failed-exec requires an interactive rebase"));
> > > +
> >
> > I was surprised at first that you checked is_interactive() rather than
> > checking for --exec being specified. But I guess this is because users
> > can manually specify 'exec' lines.
>
> Indeed, that is exactly the reason.
>
> > What if the user specifies an implicitly interactive rebase (i.e. no
> > editing of the todo list, such as with --rebase-merges or
> > --keep-empty, or soon --strategy or --strategy-option) and also
> > doesn't specify --exec?
>
> Then the todo list won't have any `exec` lines, and the flag is irrelevant
> (but does not do any harm).
>
> ... except in the case that the rebase fails at some stage, the user edits
> the todo list with `git rebase --edit-todo` and inserts an `exec` line.Ah, good point; hadn't thought of that case. Thanks for explaining.