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

Re: [PATCH] merge: --ff-one-only to apply FF if commit is one

From
Ruslan Yakauleu <ruslan.yakauleu@gmail.com>
Date
Oct 25, 2023, 18:31 UTC
Message-ID
<e38ebf04-cf92-c80b-3432-bf86ecda1054@gmail.com>
In-Reply-To
<da246287-8530-4680-8fcc-f68f881bc24b@app.fastmail.com>
Hi

If we use squash we will lose some context and occasionally, we need multiple small features combined into one big release. We would rather not mix it into one monolithic non-readable blob. For us, sometimes it is better to rebase something to make history more accurate than squash everything into one commit. We can use squash only for one story.

Anyway, squash is a different feature. Same as rebase (of course we're doing the rebase before merge to clarify history and to make some regression tests)

Then we have a set of branches. Some branches contain only one commit.
For example, we have 4 branches:
- two commits
- one commit
- one commit
- three commits

With --no-ff (only merges) we have next graph with extra merges (E', F') for branches with one commit

   B---C   E   F   G---H---I
  /     \ / \ / \ /         \
A-------D---E'--F'----------J

With --ff (fast-forward everything) we miss merge branches (D, J) and it's harder to fast revert some problematic releases properly, because it's not clear that commits G-H-I - is one release

A---B---C---E---F---G---H---I
Story which --ff-one-only should build without manual control
   B---C           G---H---I
  /     \         /         \
A-------D---E---F-----------J

There we have merge commits (D, J) only for complex branches. Branches E and F fast-forwarded to prevent extra merges.

Sorry if my explanation isn't clear enough

-- Ruslan

Previous: Kristoffer HaugsbakkNext: Kristoffer Haugsbakk
Message 3 of 15 in “merge: --ff-one-only to apply FF if commit is one”
  1. merge: --ff-one-only to apply FF if commit is oneRuslan Yakauleu via GitGitGadget, Oct 25, 2023
  2. Kristoffer HaugsbakkOct 25, 2023
  3. Ruslan YakauleuOct 25, 2023
  4. Kristoffer HaugsbakkOct 25, 2023
  5. Taylor BlauOct 30, 2023
  6. Junio C HamanoOct 31, 2023
  7. Ruslan YakauleuOct 31, 2023
  8. Junio C HamanoOct 31, 2023
  9. Kristoffer HaugsbakkOct 31, 2023
  10. Junio C HamanoNov 1, 2023
  11. Ruslan YakauleuNov 1, 2023
  12. Kristoffer HaugsbakkNov 1, 2023
  13. Junio C HamanoNov 1, 2023
  14. Ruslan YakauleuOct 31, 2023
  15. Ruslan YakauleuOct 26, 2023

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.