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, 15:38 UTC
Message-ID
<7vmwq6i93m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<51D197AD.1070502@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 6 quoted lines
> So I think that command invocations with more than one of {"--ff",
> "--no-ff", "--ff-only"} should respect the last option listed rather
> than complaining about "cannot combine options".
>
> If I find the time (unlikely) I might submit a patch to implement these
> expectations.

And I wouldn't reject it on the basis of the design --- I agree fully with your analysis above. Thanks for digging and spelling out how they should be fixed.

As to "--no-ff" vs "--ff-only", "--ff-only" has always meant "only fast-forward updates are allowed. We do not want to create a merge commit with this operation." I do agree with you that the proposed patch changes the established semantis and may be too disruptive a thing to do at this point.

> In my opinion, your use case shouldn't be supported by the command
> because (1) it is confusing, (2) it is not very common, and (3) it is
> easy to work around:
> ...

If one were designing Git merge from scratch today, however, I could see one may have designed these as two orthogonal switches.

 - Precondition on the shape of histories being merged ("fail unless
   fast forward" does not have to be the only criteria);
 - How the update is done ("fast forward to the other head", "always
   create a merge", "fast forward if possible, otherwise merge" do
   not have to be the only three choices).

I do not fundamentally oppose to such a new feature, but they have to interact sanely with the current "--ff={only,only,never}".

Previous: Miklos VajnaNext: Miklos Vajna
Message 4 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.