#5734 Fix handling of merge commits in diffs

unreleased
open
nobody
scm (10)
General
nobody
2015-01-06
2013-02-01
Cory Johns
No

Currently, diffs are computed by seeing if a tree / blob node is different in any of the parents of the commit. Instead, the node should only be considered changed in the commit if it is different from the corresponding node in all of the parent commits. (For a commit with a single parent, this amounts to the same thing. But for merge commits, if the file was changed in one branch but was not touched in the other branch and there are thus no conflicts, then it wasn't really changed in the merge commit.)

This doesn't affect SVN, and probably doesn't affect Mercurial, due to the way they do branching, but Mercurial should be confirmed that it will behave well with this new logic.

Related

Tickets: #6686

Discussion

  • Cory Johns - 2013-02-01
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,3 @@
    -Currently, diffs are computed by seeing if a tree / blob node is the same in the first parent and is considered changed if it doesn't match the first parent.  However, for merge commits, the correct logic is for the node to be compared to the corresponding node in *each* of the parents and considered changed in the merge commit only if it different from *all* of the parents.  (This happens if the file was changed in one branch but was not touched in the other branch and there are thus no conflicts.)
    +Currently, diffs are computed by seeing if a tree / blob node is different in *any* of the parents of the commit.  Instead, the node should only be considered changed in the commit if it is different from the corresponding node in *all* of the parent commits.  (For a commit with a single parent, this amounts to the same thing.  But for merge commits, if the file was changed in one branch but was not touched in the other branch and there are thus no conflicts, then it wasn't really changed in the merge commit.)
    
     This doesn't affect SVN, and probably doesn't affect Mercurial, due to the way they do branching, but Mercurial should be confirmed that it will behave well with this new logic.
    
     
  • Dave Brondsema

    Dave Brondsema - 2013-10-21
    • summary: Fix handling of merge commits --> Fix handling of merge commits in diffs
     

Log in to post a comment.