Re: [PATCH v5 2/3] pull: move default warning
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Dec 12, 2020, 01:05 UTC
- Message-ID
- <CAMP44s1v+ESk9y8WC8rKPb61KD_kUoM9F1gO-TZhEEgOzUAPTw@mail.gmail.com>
- In-Reply-To
- <xmqq360bj3kt.fsf@gitster.c.googlers.com>
On Fri, Dec 11, 2020 at 6:00 PM Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 19 quoted lines
> > Should actually be something like:
> >
> > if (rebase_unspecified && !can_ff)
> > die("Not a fast-forward; must either merge or rebase");
>
> The illustration I gave in the message you are responding to was
> made in the context of patch 2/3; with patch 3/3 where can_ff
> exists, it would not become like what you gave above. It should
> instead become
>
> if (rebase_unspecified && !opt_ff && !can_ff) {
> if (opt_verbosity >= 0 && advice_pull_non_ff)
> show_advice_pull_non_ff();
> die("not a fast-forward; must merge or rebase");
> }
>
> i.e. when we can fast-forward, we do not trigger the "you must
> specify rebase/merge" message, and we do not trigger the "not a
> fast-forward" error.It's not the !can_ff part I'm trying to highlight, it's the lack of advice *after* we have decided to flip the switch.
As I said in another thread: I don't think we have any long condescending error in any other command.
Cheers.
-- Felipe Contreras