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
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 18, 2020, 20:46 UTC
Message-ID
<5fdd154264baf_130e182082b@natae.notmuch>
In-Reply-To
<5fd8aa6a52e81_190cd7208c8@natae.notmuch>
Felipe Contreras wrote:
> Junio C Hamano wrote:
Show 31 quoted lines
> > "--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.
> 
> But we shoud not imply what the user didn't say.
> 
> Yes, "--no-ff --rebase" is obviously nonsense, but that's a
> simplification of setups the user may have, for example:
> 
>   git config pull.ff false
>   git pull --rebase
> 
> Here, I think the user is saying: "please do a rebase, and ignore the
> pull.ff configuration".
> 
> But the other way would be:
> 
>   git config pull.rebase true
>   git pull --no-ff
> 
> Following the same logic, the user is saying: "please do a
> non-fast-forward [merge], and ignore the pull.rebase configuration".
> 
> Either we imply the merge, or we don't.
> 
> I don't think it makes sense for the code to imply the user did say
> --merge, and therefore don't show the advice (or in the future error
> out), but then continue as if the user did say --rebase.

I didn't see a response to this, but after thinking more about, I think I have a clean solution: just remove all the opt_ff logic altogether.

It's clear --ff doesn't imply a merge, so we shouldn't act as if it was.
The warning should still be displayed.
-- 
Felipe Contreras
Previous: Felipe ContrerasNext: Junio C Hamano
Message 19 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.