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

Re: [RFC/PATCH] Fast forward strategies allow, never, and only

From
Ccolin@horizon.com <colin@horizon.com>
Date
Mar 11, 2008, 09:35 UTC
Message-ID
<20080311093553.23191.qmail@science.horizon.com>
> What's lacking is "why this is a good idea".

Seconded. A long time ago (and I'm too lazy to find a link), Linus explained why disabling fast-forward merges was almost always a Bad Idea, and nobody has come up with a good reason why you'd want one since.

But from memory, suppose that you have two developers, each working on their own branch:

     a--a--a <-- A's head
    /
o--o
    \
     b--b--b <-- B's head

Then suppose that they merge back and forth to get to the same state. With fast-forward merges, it will go like this:

A merges from B:
     a--a--a
    /       \
o--o         o <-- A's head
    \       /
     b--b--b <-- B's head
Then B merges from A:
     a--a--a
    /       \
o--o         o <-- Both heads
    \       /
     b--b--b

And look, they are in sync and can go on to develop from a common base version. Future merges will do nothing.

If, instead, you have every merge generate a commit, then you get:
     a--a--a
    /       \
o--o         o <-- A's head
    \       / \
     b--b--b---o <-- B's head
     a--a--a
    /       \
o--o         o---o <-- A's head
    \       / \ /
     b--b--b---o <-- B's head
     a--a--a
    /       \
o--o         o---o <-- A's head
    \       / \ / \
     b--b--b---o---o <-- B's head

.. and it never ends. All of the merged commits are identical trees, but if you insist on creating a new commit object each time, you can generate an infinite number of bogus commits, and more to the point, A and B will never actually agree on the current HEAD commit.

With more developers, you can make even more of a mess.

What use does the "--ff=never" option have except to generate this cruft? Flexibility is useful only as long as it provides the ability to do something desirable. There's no point to having a button that should never be pushed.

Next: Lars Hjemli
Message 1 of 5 in “Re: [RFC/PATCH] Fast forward strategies allow, never, and only”
  1. colin@horizon.comMar 11, 2008
  2. Lars HjemliMar 11, 2008
  3. Bruce StephensMar 11, 2008
  4. Bruce StephensMar 11, 2008
  5. Junio C HamanoMar 12, 2008

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.