Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Question Why do I need the third "middle" pane in 3-way merge??

    Hi guys,

    First! Love your tool! After being introduced to it about a year ago, merging has become much easier!

    BUT! I haven't been able to quite grasp the value of the third "middle" pane in the 3-way merge. I have asked my colleagues to explain it to me, but the ones who start explaining all end up more confused than when they started, and the rest tell me they don't know what it is for.

    I can read that it is the "common ancestor", but I am not sure what that actually means.

    Can anyone draw up a scenario of how I would use it?

    People rave about it, so I would really like to know what I am missing out on, and possibly make my merges much easier.

    Thanks.
    Jay

  2. #2
    Join Date
    Oct 2007
    Location
    Pennsylvania
    Posts
    1,772

    Default

    The middle pane is for the common ancestor. Here are two older posts of mine that provide further discussion on the concepts of 3-way merges and compares:

    http://www.scootersoftware.com/vbull...st.php?p=25841
    http://www.scootersoftware.com/vbull...st.php?p=22572

    and a short description on wikipedia:

    http://en.wikipedia.org/wiki/3-way_m...hree-way_merge

    3-way merge utilities are often used in conjunction with change control / version management software to merge together two sets of changes independently made to two different copies of the same file in concurrent efforts by two different programming units (individuals or teams).
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

  3. #3
    Join Date
    Mar 2011
    Posts
    4

    Question Still confused...

    OK... I think I was just waiting for another reply and then forgot, since I didn't really get an explanation. Now I want to explain this to a collegue of mine, but still don't know what goes on.

    What is a "common ancestor"?

    Have I understood this correctly when I give you this scenario:

    Using Git source control, I try to do a "git pull" and end up in a merge conflict. So I do "git mergetool" and that way bring up Beyond Compare three way merge.

    Am I right to assume the following:

    Left Pane: This is the file that I am trying to download from git origin.
    Right Pane: This is my version of the file.
    Middle Pane: This is how my file looked before I started editing it.

    What value does the middle pane bring to the merge?
    What should I look for in the middle pane?
    When would the merge suggest content from the middle pane?

    /Jay

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    The biggest thing the middle pane brings is it helps lessen the number of "conflicts" that must be manually resolved. For example, with just two panes (theirs and yours) any change you made would show up as a conflict. If a third party were viewing it, however, they would not know if your file had the change or the other file was actually the change. They can only observe there is a difference between the files and that one or both sides must have been edited.

    With an Ancestor, it is immediately clear that if the Ancestor and one side are identical and the third pane has a difference, then that difference is new and should be merged in.

    Conflicts then only arise when the same lines were changed in different ways on both the left and right sides.
    Aaron P Scooter Software

  5. #5
    Join Date
    Mar 2011
    Posts
    4

    Default

    So I am right in my assumption that the "common ancestor" is what the file looked like before I started editing... and therefore also before someone else started editing.

    Now it makes sense!

    Thanks!

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Yep, the ancestor should be the file at the state you downloaded a fresh, updated copy from the common repository. So, if anyone else submits it back (merging their own changes back in), that would be the Theirs pane. If no one submits back in the meantime, then the Theirs pane and Ancestor pane would be equal; or most Source Control solutions would detect this case and just upload Your file.

    Update: The key fact is that you must get the most recent submitted version from the source control before you start editing. If your Ancestor is older, and there has been a more recent submission, then it will be more difficult to merge.
    Last edited by Aaron; 11-Oct-2012 at 08:17 AM. Reason: Update:
    Aaron P Scooter Software

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •