{"thread":{"id":"24566","subject":"What is the scenario for a commit with 3 or more parents","startedAt":"2010-07-29T02:05:31Z","lastAt":"2010-07-29T21:01:33Z","messageCount":9,"participants":["Bradley Wagner","Shawn O. Pearce","Sverre Rabbelier","Joshua Juran","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"146683","messageId":"AANLkTikMRa_LrD2fU9Piv3GW2H0r7Jf_9s5iM0wc9t6s@mail.gmail.com","threadId":"24566","inReplyTo":null,"subject":"What is the scenario for a commit with 3 or more parents","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-29T02:05:31Z","receivedAt":"2010-07-29T02:05:31Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"I was reading over the Specifying Revisions section in the man entry\ngitrevisions. I understand having 2 parent commits with a merge.\n\nI was trying to understand the HEAD^2 style syntax and wondering where\nHEAD^3 would be used. From the example diagram, this would be Commit B\nbut I'm unclear how this would ever happen. Is this some kind of\nmulti-way merge?\n\nDoes git log show the parents in their ordinal order in the \"Merge:\" line?\n"},{"id":"146684","messageId":"20100729021946.GG25268@spearce.org","threadId":"24566","inReplyTo":"AANLkTikMRa_LrD2fU9Piv3GW2H0r7Jf_9s5iM0wc9t6s@mail.gmail.com","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-07-29T02:19:46Z","receivedAt":"2010-07-29T02:19:46Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Bradley Wagner <bradley.wagner@hannonhill.com> wrote:\n> I was reading over the Specifying Revisions section in the man entry\n> gitrevisions. I understand having 2 parent commits with a merge.\n> \n> I was trying to understand the HEAD^2 style syntax and wondering where\n> HEAD^3 would be used. From the example diagram, this would be Commit B\n> but I'm unclear how this would ever happen. Is this some kind of\n> multi-way merge?\n\nYes.  Its called an octopus merge.  It happpens sometimes when\nmerging 2 or more otherwise fairly isolated changes in a single\nshot.  E.g. `git merge feature-a feature-b thing-c`.\n \n> Does git log show the parents in their ordinal order in the \"Merge:\" line?\n\nYes.\n\n-- \nShawn.\n"},{"id":"146724","messageId":"AANLkTik-wOB-iEGK8EnW1Rdk9wwc1E86tYoBU26WepYJ@mail.gmail.com","threadId":"24566","inReplyTo":"20100729021946.GG25268@spearce.org","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-07-29T17:55:18Z","receivedAt":"2010-07-29T17:55:18Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Jul 28, 2010 at 21:19, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Yes.  Its called an octopus merge.  It happpens sometimes when\n> merging 2 or more otherwise fairly isolated changes in a single\n> shot.  E.g. `git merge feature-a feature-b thing-c`.\n\nDo we have an explanation anywhere as to when one would use a octopus merge?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"146725","messageId":"AANLkTimxcnTkJLqX6qfdYWHrgXOzZ-Rk_48KHyip39ay@mail.gmail.com","threadId":"24566","inReplyTo":"AANLkTik-wOB-iEGK8EnW1Rdk9wwc1E86tYoBU26WepYJ@mail.gmail.com","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-29T17:57:53Z","receivedAt":"2010-07-29T17:57:53Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"On Thu, Jul 29, 2010 at 1:55 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n>\n> Heya,\n>\n> On Wed, Jul 28, 2010 at 21:19, Shawn O. Pearce <spearce@spearce.org> wrote:\n> > Yes.  Its called an octopus merge.  It happpens sometimes when\n> > merging 2 or more otherwise fairly isolated changes in a single\n> > shot.  E.g. `git merge feature-a feature-b thing-c`.\n>\n> Do we have an explanation anywhere as to when one would use a octopus merge?\n\nAnother question I had about this: isn't this documentation about\n\"multi-way merge\" inaccurate:\nhttp://book.git-scm.com/5_advanced_branching_and_merging.html.\n\nSounds like it's not equivalent to merging each branch individually.\n\n>\n> --\n> Cheers,\n>\n> Sverre Rabbelier\n"},{"id":"146726","messageId":"C77AA970-4288-487F-9568-E86CF776FCED@gmail.com","threadId":"24566","inReplyTo":"AANLkTik-wOB-iEGK8EnW1Rdk9wwc1E86tYoBU26WepYJ@mail.gmail.com","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Joshua Juran","fromEmail":"jjuran@gmail.com","sentAt":"2010-07-29T18:10:45Z","receivedAt":"2010-07-29T18:10:45Z","isPatch":false,"sender":{"key":"jjuran@gmail.com","avatar":null},"body":"On Jul 29, 2010, at 10:55 AM, Sverre Rabbelier wrote:\n\n> Heya,\n>\n> On Wed, Jul 28, 2010 at 21:19, Shawn O. Pearce <spearce@spearce.org>  \n> wrote:\n>> Yes.  Its called an octopus merge.  It happpens sometimes when\n>> merging 2 or more otherwise fairly isolated changes in a single\n>> shot.  E.g. `git merge feature-a feature-b thing-c`.\n>\n> Do we have an explanation anywhere as to when one would use a  \n> octopus merge?\n\nHow about if you had two (or more) components with a shared protocol,  \nand you updated each to speak a new (and incompatible) protocol.  The  \nchanges to each component might be done in separate topic branches,  \nbut you'd want to merge them all at once.\n\n$ git checkout master\n$ git merge client-v2 server-v2\n\nJosh\n"},{"id":"146727","messageId":"AANLkTikpLHdMzbpix8jnyS6YwSkgie=Ts44AJP5dA4=T@mail.gmail.com","threadId":"24566","inReplyTo":"C77AA970-4288-487F-9568-E86CF776FCED@gmail.com","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-07-29T18:22:01Z","receivedAt":"2010-07-29T18:22:01Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Jul 29, 2010 at 13:10, Joshua Juran <jjuran@gmail.com> wrote:\n> How about if you had two (or more) components with a shared protocol, and\n> you updated each to speak a new (and incompatible) protocol.  The changes to\n> each component might be done in separate topic branches, but you'd want to\n> merge them all at once.\n>\n> $ git checkout master\n> $ git merge client-v2 server-v2\n\nVery nice example, but do we have it _documented_ anywhere? If not, it\nwould be great if you could add that somewhere :)\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"146730","messageId":"7vzkxarqry.fsf@alter.siamese.dyndns.org","threadId":"24566","inReplyTo":"AANLkTikpLHdMzbpix8jnyS6YwSkgie=Ts44AJP5dA4=T@mail.gmail.com","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-29T20:12:33Z","receivedAt":"2010-07-29T20:12:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sverre Rabbelier <srabbelier@gmail.com> writes:\n\n> Heya,\n>\n> On Thu, Jul 29, 2010 at 13:10, Joshua Juran <jjuran@gmail.com> wrote:\n>> How about if you had two (or more) components with a shared protocol, and\n>> you updated each to speak a new (and incompatible) protocol.  The changes to\n>> each component might be done in separate topic branches, but you'd want to\n>> merge them all at once.\n>>\n>> $ git checkout master\n>> $ git merge client-v2 server-v2\n>\n> Very nice example, but do we have it _documented_ anywhere? If not, it\n> would be great if you could add that somewhere :)\n\nPlease don't.\n\nI actually do not think the \"client-server\" is a good example from\nsoftware engineering point-of-view, as it means that everybody talks\nversion 1 before that merge and everybody talks version 2 after that\nmerge, i.e. you have a flag day event.\n\nThink for 5 seconds how one would have tested client-v2 topic alone in\nisolation.\n\nThe only transition plan that works in real life is for the updated client\nto talk fine with a server without version 2 support, while being prepared\nto talk the newer protocol if the server supports it.  The server side\nneeds to be arranged in a similar way.\n\nIf that is how these topics were developed, you should be able to merge\nclient-v2 topic and then server-v2 topic, or in the other order, without\nbreaking anything on the master branch.\n\nThe original idea of Octopus was that, when\n\n (1) you have many topics that are not inter-related; _and_\n\n (2) merging all of them in any random order wouldn't have made any\n     difference in the resulting history, either in the end result nor in\n     any of the intermediate steps,\n\nit is not worth to serialize the merge order and create extra merge\ncommits.\n\nI think we tend to discourage the use of Octopus these days, as people are\nfallible.  When topics that they originally thought are independent turn\nout to have funny interactions among each other, having an Octopus merge\nacross them tends to make bisection much less efficient in order to find\nthe real culprit in the history when you find something is broken.\n\nCompared to that downside, it is not worth to use an Octopus, only to have\na smaller number of merge commits and a cool-looking lantern-shaped merge\ncommit in the history.\n"},{"id":"146732","messageId":"AANLkTinT4SpdYHfaiwPqVHDEaN6gEr-3kyHbE4-g=HN5@mail.gmail.com","threadId":"24566","inReplyTo":"7vzkxarqry.fsf@alter.siamese.dyndns.org","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-07-29T20:50:33Z","receivedAt":"2010-07-29T20:50:33Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Jul 29, 2010 at 15:12, Junio C Hamano <gitster@pobox.com> wrote:\n> Compared to that downside, it is not worth to use an Octopus, only to have\n> a smaller number of merge commits and a cool-looking lantern-shaped merge\n> commit in the history.\n\nOk, do we have _that_ documented anywhere?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"146733","messageId":"7vvd7yroia.fsf@alter.siamese.dyndns.org","threadId":"24566","inReplyTo":"AANLkTinT4SpdYHfaiwPqVHDEaN6gEr-3kyHbE4-g=HN5@mail.gmail.com","subject":"Re: What is the scenario for a commit with 3 or more parents","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-29T21:01:33Z","receivedAt":"2010-07-29T21:01:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sverre Rabbelier <srabbelier@gmail.com> writes:\n\n> On Thu, Jul 29, 2010 at 15:12, Junio C Hamano <gitster@pobox.com> wrote:\n>> Compared to that downside, it is not worth to use an Octopus, only to have\n>> a smaller number of merge commits and a cool-looking lantern-shaped merge\n>> commit in the history.\n>\n> Ok, do we have _that_ documented anywhere?\n\nOutside the list archive, I don't think so.\n"}]}