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

Re: [PATCH] merge: allow using --no-ff and --ff-only at the same time

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 1, 2013, 16:43 UTC
Message-ID
<7va9m6i63i.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130701161009.GI17269@suse.cz>
Miklos Vajna <vmiklos@suse.cz> writes:
> OK, so if I get it right, the problem is that users got used to
> that the --ff-only not only means a precondition for the merge,
> but also means "either don't create a merge commit or fail", while
> my patch would change this second behaviour.

It is not just "users got used to". "We do not want to create a merge commit with this operation." is what "--ff-only" means from the day one [*1*].

For a merge not to create an extra merge commit, the other history has to be a proper descendant, but that "precondition" is a mere logical consequence of the ultimate goal of the mode.

> I could imagine then new switches, like 'git merge --pre=ff
> --update=no-ff" could provide these, though I'm not sure if it makes
> sense to add such generic switches till the only user is "ff".

Yes, that is why I said "if one were designing it from scratch, I could see..." in a very weak form.

[Footnote]

*1* 13474835 (Teach 'git merge' and 'git pull' the option --ff-only, 2009-10-29) and also $gmane/107768 whose documentation part says:

  "Refuse to merge unless the merge is resolved as a fast-forward."
Previous: Miklos VajnaNext: Miklos Vajna
Message 6 of 12 in “merge: allow using --no-ff and --ff-only at the same time”
  1. merge: allow using --no-ff and --ff-only at the same timeMiklos Vajna, Jul 1, 2013
  2. Michael HaggertyJul 1, 2013
  3. Miklos VajnaJul 1, 2013
  4. Junio C HamanoJul 1, 2013
  5. Miklos VajnaJul 1, 2013
  6. Junio C HamanoJul 1, 2013
  7. merge: handle --ff/--no-ff/--ff-only as a tri-state optionMiklos Vajna, Jul 1, 2013
  8. Junio C HamanoJul 1, 2013
  9. Michael HaggertyJul 2, 2013
  10. merge: handle --ff/--no-ff/--ff-only as a tri-state optionMiklos Vajna, Jul 2, 2013
  11. Junio C HamanoJul 2, 2013
  12. Junio C HamanoJul 2, 2013

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.