What is the scenario for a commit with 3 or more parents

6 messages, 4 authors, 2016-06-15 · open the first message on its own page

What is the scenario for a commit with 3 or more parents

From: Bradley Wagner <hidden>
Date: 2016-06-15 22:49:12

I was reading over the Specifying Revisions section in the man entry
gitrevisions. I understand having 2 parent commits with a merge.

I was trying to understand the HEAD^2 style syntax and wondering where
HEAD^3 would be used. From the example diagram, this would be Commit B
but I'm unclear how this would ever happen. Is this some kind of
multi-way merge?

Does git log show the parents in their ordinal order in the "Merge:" line?

Re: What is the scenario for a commit with 3 or more parents

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:49:12

Bradley Wagner [off-list ref] wrote:
I was reading over the Specifying Revisions section in the man entry
gitrevisions. I understand having 2 parent commits with a merge.

I was trying to understand the HEAD^2 style syntax and wondering where
HEAD^3 would be used. From the example diagram, this would be Commit B
but I'm unclear how this would ever happen. Is this some kind of
multi-way merge?
Yes.  Its called an octopus merge.  It happpens sometimes when
merging 2 or more otherwise fairly isolated changes in a single
shot.  E.g. `git merge feature-a feature-b thing-c`.
 
Does git log show the parents in their ordinal order in the "Merge:" line?
Yes.

-- 
Shawn.

Re: What is the scenario for a commit with 3 or more parents

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:49:13

Heya,

On Wed, Jul 28, 2010 at 21:19, Shawn O. Pearce [off-list ref] wrote:
Yes.  Its called an octopus merge.  It happpens sometimes when
merging 2 or more otherwise fairly isolated changes in a single
shot.  E.g. `git merge feature-a feature-b thing-c`.
Do we have an explanation anywhere as to when one would use a octopus merge?

-- 
Cheers,

Sverre Rabbelier

Re: What is the scenario for a commit with 3 or more parents

From: Bradley Wagner <hidden>
Date: 2016-06-15 22:49:13

On Thu, Jul 29, 2010 at 1:55 PM, Sverre Rabbelier [off-list ref] wrote:
Heya,

On Wed, Jul 28, 2010 at 21:19, Shawn O. Pearce [off-list ref] wrote:
quoted
Yes.  Its called an octopus merge.  It happpens sometimes when
merging 2 or more otherwise fairly isolated changes in a single
shot.  E.g. `git merge feature-a feature-b thing-c`.
Do we have an explanation anywhere as to when one would use a octopus merge?
Another question I had about this: isn't this documentation about
"multi-way merge" inaccurate:
http://book.git-scm.com/5_advanced_branching_and_merging.html.

Sounds like it's not equivalent to merging each branch individually.
--
Cheers,

Sverre Rabbelier

Re: What is the scenario for a commit with 3 or more parents

From: Joshua Juran <hidden>
Date: 2016-06-15 22:49:13

On Jul 29, 2010, at 10:55 AM, Sverre Rabbelier wrote:
Heya,

On Wed, Jul 28, 2010 at 21:19, Shawn O. Pearce [off-list ref]  
wrote:
quoted
Yes.  Its called an octopus merge.  It happpens sometimes when
merging 2 or more otherwise fairly isolated changes in a single
shot.  E.g. `git merge feature-a feature-b thing-c`.
Do we have an explanation anywhere as to when one would use a  
octopus merge?
How about if you had two (or more) components with a shared protocol,  
and you updated each to speak a new (and incompatible) protocol.  The  
changes to each component might be done in separate topic branches,  
but you'd want to merge them all at once.

$ git checkout master
$ git merge client-v2 server-v2

Josh

Re: What is the scenario for a commit with 3 or more parents

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:49:13

Heya,

On Thu, Jul 29, 2010 at 13:10, Joshua Juran [off-list ref] wrote:
How about if you had two (or more) components with a shared protocol, and
you updated each to speak a new (and incompatible) protocol.  The changes to
each component might be done in separate topic branches, but you'd want to
merge them all at once.

$ git checkout master
$ git merge client-v2 server-v2
Very nice example, but do we have it _documented_ anywhere? If not, it
would be great if you could add that somewhere :)

-- 
Cheers,

Sverre Rabbelier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help