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

Re: [PATCH v7 0/5] making pull advice not to trigger when unneeded

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 15, 2020, 10:58 UTC
Message-ID
<xmqqmtyf8hfm.fsf@gitster.c.googlers.com>
In-Reply-To
<5fd85811c3a6_d7c48208aa@natae.notmuch>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 8 quoted lines
>> To avoid the ugly-looking "strcmp()" in the above, we may need to
>> adjust "--ff" (fast-forward without creating an extra merge commit)
>> and "--no-ff" (create an extra merge commit when the history could
>> be fast-forwarded) to imply "merge", though.
>> ...
>
> Or do you mean --ff doesn't override --rebase? Therefore it's more of an
> internal conceptual change.

I meant "--ff/--no-ff" without saying anything between merge and rebase would make merge implied. It was merely for the purpose of getting rid of !opt_ff in the condition there and such an implied merge would be one way to ensure that rebase_unspecified becomes false.

"--no-ff --rebase" (in any order) would be a nonsense combination, as it asks "please create an extra merge commit even when the history fast-forwards, but by the way I do not want merge I want rebase" [*1*]. It should error out when the history fast-forwards, I think, and it probably should also error out when the history does not fast-forward, instead of rebasing.

"--ff --rebase" (in any order), on the other hand, would be "if the history fast-forwards, just do so without creating an extra merge commit, by the way, I prefer rebase and not merge". If the history fast-forwards, it is OK to just fast-forward (using the merge backend if needed), as rebasing against the history that is ahead of us would mean all our unique development since we diverged from them, which is nothing, will be replayed on top of their history. If the history does not fast-forward, then the precondition of "--ff" part does not hold, so just rebasing as if "--ff" does not exist would probably be OK, too.

In any case, I haven't thought the opt_ff part of the expression through. During the review of v5 3/3 (and doing v7 5/5), what I was more interested in was to ensure the verbosity option, which would control how verbose a message we should be giving, can stay independent of other conditionals, which would control if we even need to error out and/or give hints.

Thanks.
[Footnote]

*1* Even though the current code may simply ignore --no-ff after the control is given to the rebase codepath,

Previous: Felipe ContrerasNext: Felipe Contreras
Message 17 of 21 in “making pull advice not to trigger when unneeded”
  1. 0/5 making pull advice not to trigger when unneededJunio C Hamano, Dec 14, 2020
  2. 2/5 pull: give the advice for choosing rebase/merge much laterJunio C Hamano, Dec 14, 2020
  3. 3/5 pull: get rid of unnecessary global variableJunio C Hamano, Dec 14, 2020
  4. Felipe ContrerasDec 14, 2020
  5. Junio C HamanoDec 14, 2020
  6. Felipe ContrerasDec 15, 2020
  7. 4/5 pull: correct condition to trigger non-ff adviceJunio C Hamano, Dec 14, 2020
  8. Felipe ContrerasDec 14, 2020
  9. Junio C HamanoDec 14, 2020
  10. Felipe ContrerasDec 15, 2020
  11. 1/5 pull: refactor fast-forward checkJunio C Hamano, Dec 14, 2020
  12. 5/5 pull: display default warning only when non-ffJunio C Hamano, Dec 14, 2020
  13. Felipe ContrerasDec 14, 2020
  14. Junio C HamanoDec 14, 2020
  15. Felipe ContrerasDec 15, 2020
  16. Felipe ContrerasDec 15, 2020
  17. Junio C HamanoDec 15, 2020
  18. Felipe ContrerasDec 15, 2020
  19. Felipe ContrerasDec 18, 2020
  20. Junio C HamanoDec 23, 2020
  21. Felipe ContrerasDec 23, 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.