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

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

From
Sverre Hvammen Johansen <hvammen@gmail.com>
Date
Mar 19, 2008, 06:20 UTC
Message-ID
<402c10cd0803182320k134116cas5f62389482f2650a@mail.gmail.com>
In-Reply-To
<m363vkvvzb.fsf@localhost.localdomain>

Thanks to you and everyone else for useful input. Some of this input ended up in the documentation. I will provide an updated patch tomorrow. I expect to have a final patch for submission some time next week.

I have added some more documentation:
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 2af33d8..5af5436 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -36,7 +36,7 @@ include::merge-options.txt[]
 <remote>::
        Other branch head merged into our branch.  You need at
        least one <remote>.  Specifying more than one <remote>
-       obviously means you are trying an Octopus.
+       usually means you are trying an Octopus.


 include::fast-forward-options.txt[]
@@ -133,6 +133,47 @@ merge (which is typically a fraction of the whole
tree), you can
 have local modifications in your working tree as long as they do
 not overlap with what the merge updates.

+If more than one commit are specified for the merge, git will try to
+reduce the number of commits (real parents) by eliminating commits
+than can be reached from other commits.  The commit message will
+reflect the actual commits specified but the merge strategy will be
+selected based on the real parents always including `HEAD`.  The real
+parents (only including `HEAD` if it is real) are the parents recorded
+in the merge commit object.
+
+The following shows master and three topic branches.  TopicB is based
+on TopicA, TopicA is previously branched off from master, and TopicC
+is based on the current `HEAD` of master:
+
+------------
+                    o---o---o  TopicB
+                   /
+          o---o---o  TopicA
+         /
+    o---o---o---o---o---o  master
+                         \
+                          o---o  TopicC
+------------
+
+A merger of master with TopicA, TopicB, and TopicC will select the
+merge strategy based on the three branches master, TopicB, and TopicC
+(TopicA is eliminated since it can be reached from TopicB).  TopicB
+and TopicC are the only real parents and are therefore the only
+parents recorded in the merge commit object:
+
+------------
+         % git co master
+         % git merge TopicA TopicB TopicC
+
+                    o---o---o  TopicB
+                   /         \
+          o---o---o  TopicA   \
+         /                     \
+    o---o---o---o---o---o       o  master
+                         \     /
+                          o---o  TopicC
+------------
+
 When there are conflicts, these things happen:

 1. `HEAD` stays the same.

On Tue, Mar 18, 2008 at 8:27 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>  I'd mention here receive.denyNonFastForward option as a way to set
>  this globally for all branches, for public bare publishing
>  repositories; AFAIK for push and I think also for fetch.

The denyNonFastForward option have nothing to do with merges.  It only
applies to push on the server side.  A merge is not involved when
doing a push.
-- 
Sverre Hvammen Johansen
Previous: Jakub NarebskiNext: Jakub Narebski
Message 17 of 27 in “Fast forward strategies allow, never, and only”
  1. Fast forward strategies allow, never, and onlySverre Hvammen Johansen, Mar 11, 2008
  2. Sverre Hvammen JohansenMar 11, 2008
  3. Ping YinMar 11, 2008
  4. Junio C HamanoMar 11, 2008
  5. Sverre Hvammen JohansenMar 12, 2008
  6. Sverre Hvammen JohansenMar 16, 2008
  7. Sverre Hvammen JohansenMar 14, 2008
  8. Jakub NarebskiMar 11, 2008
  9. Sverre Hvammen JohansenMar 12, 2008
  10. Junio C HamanoMar 12, 2008
  11. Sverre Hvammen JohansenMar 12, 2008
  12. Sverre Hvammen JohansenMar 18, 2008
  13. Ping YinMar 18, 2008
  14. Sverre Hvammen JohansenMar 18, 2008
  15. Jon LoeligerMar 18, 2008
  16. Jakub NarebskiMar 18, 2008
  17. Sverre Hvammen JohansenMar 19, 2008
  18. Jakub NarebskiMar 19, 2008
  19. Sverre Hvammen JohansenMar 20, 2008
  20. Junio C HamanoMar 19, 2008
  21. Sverre Hvammen JohansenMar 20, 2008
  22. Junio C HamanoMar 22, 2008
  23. Sverre Hvammen JohansenMar 26, 2008
  24. Sverre Hvammen JohansenMar 31, 2008
  25. Fast forward strategies allow, never, and onlySverre Hvammen Johansen, Apr 20, 2008
  26. Junio C HamanoApr 22, 2008
  27. Sverre Hvammen JohansenApr 24, 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.