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