git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5 2/3] pull: move default warning

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2020, 20:58 UTC
Message-ID
<xmqqpn3cep51.fsf@gitster.c.googlers.com>
In-Reply-To
<CAMP44s1v+ESk9y8WC8rKPb61KD_kUoM9F1gO-TZhEEgOzUAPTw@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 28 quoted lines
> On Fri, Dec 11, 2020 at 6:00 PM Junio C Hamano <gitster@pobox.com> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> > 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.

Only the "not a fast-forward and you must choose between merge and rebase" part (i.e. what I listed as the first part of three-part message) is the error.

The rest, the message that teaches how to choose between merge and rebase from command line and configuration (or how to choose permanently not to make the choice between the two), is not an error---it's called advice.

Even if we were to introduce the third choice (i.e. permanently not to choose between rebase or merge and instead just error out without getting advice), the advice must stay for those who didn't make any choice among the three (i.e. merge, rebase or ff-only).

We have many of them. An easy example to spot is a similar sized onefor "git checkout HEAD^0". Neither that one or the one under discussion is particularly condescending.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 7 of 26 in “pull: stop warning on every pull”
  1. 0/3 pull: stop warning on every pullFelipe Contreras, Dec 10, 2020
  2. 2/3 pull: move default warningFelipe Contreras, Dec 10, 2020
  3. Junio C HamanoDec 11, 2020
  4. Felipe ContrerasDec 11, 2020
  5. Junio C HamanoDec 12, 2020
  6. Felipe ContrerasDec 12, 2020
  7. Junio C HamanoDec 13, 2020
  8. Felipe ContrerasDec 14, 2020
  9. Felipe ContrerasDec 12, 2020
  10. 1/3 pull: refactor fast-forward checkFelipe Contreras, Dec 10, 2020
  11. Junio C HamanoDec 11, 2020
  12. Felipe ContrerasDec 12, 2020
  13. 3/3 pull: display default warning only when non-ffFelipe Contreras, Dec 10, 2020
  14. Junio C HamanoDec 11, 2020
  15. Felipe ContrerasDec 11, 2020
  16. Junio C HamanoDec 11, 2020
  17. Felipe ContrerasDec 12, 2020
  18. Junio C HamanoDec 12, 2020
  19. Felipe ContrerasDec 12, 2020
  20. Junio C HamanoDec 14, 2020
  21. Felipe ContrerasDec 14, 2020
  22. Junio C HamanoDec 11, 2020
  23. Felipe ContrerasDec 11, 2020
  24. Junio C HamanoDec 12, 2020
  25. Felipe ContrerasDec 12, 2020
  26. Felipe ContrerasDec 14, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.