4-way diff (base,ours,theirs,merged) to review merge results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Combined diff only tells you what the merge result auto-resolved (with 
rerere turned off and no merge-conflicts) in comparison to "ours" and 
"theirs".  That only tells you what "ours" and "theirs" *had*, not what they 
*did* (or were trying to do).  You need the merge-base version to see what 
"ours" and "theirs" did.  Seeing what "ours" and "theirs" did will 
much-better tell you if "merged" did-the-right-thing or not.  What is the 
best way to display a 4-way diff of merge-base, "ours", "theirs", and 
"merged" after a merge completes so you can review the "merged" results for 
correctness?

Before I try writing a script to dump the object-contents of the merge-base, 
"ours", "theirs", and "merged" versions of the-file-in-question to 
work-files and then feed them to a 4-way diff for review, I would like to 
see if someone already has a script or better-idea for this, or if git has 
something more straight-forward that already does-this-for-you.

Reason for this:
If "ours" has line-x and "theirs" does not have line-x, and "merged" does 
have line-x you still have a mystery on your hands:

(Combined diff)
ours:  has line-x
theirs (master):  does not have line-x
merged:  has line-x
merge-base (older master):  *may-or-may-not* have line-x
conclusion:  I'm not very sure if "merged" should have line-x or not...

Based on the combined-diff only, I don't know if "merged" should have line-x 
or not because I don't know if "ours" *added* line-x to the merge-base or if 
"theirs" *removed* line-x from the merge-base.  IOW, if "theirs" is master 
and "ours" is way-behind master then I pretty-much know I probably need to 
take "theirs" because it has the latest-stuff.  However, I don't know if 
"theirs" took line-x out of master (and "ours" just has line-x because its 
old), or if line-x was never in master and "ours" really-needed to add it. 
Having merge-base context allows for more accurate conclusions like this:

ours:  has line-x
theirs (master):  does not have line-x
merged:  has line-x
merge-base (older master):  has line-x
conclusion:  I should probably take line-x out of "merged"

ours:  has line-x
theirs (master):  does not have line-x
merged:  has line-x
merge-base:  does not have line-x
conclusion:  I should probably keep line-x in "merged"

Thanks in advance for you feedback.

v/r,
neal 



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]