Page MenuHomePhabricator

Update revisions with merge/rebase diffs so incremental changes can be shown
Open, NormalPublic

Description

When comparing two versions of a revision, especially if there has been a long time between them, chances are that there will be changes to the same files from other commits showing up. It should be possible to identify and remove those changes from the "incremental difference" between two diffs on the same revision.

Event Timeline

In the general case, this is impossible while remaining meaningful. Suppose you have three commits, A (first version of the change), M (caused by a merge or rebase some time later) and B (updates to A).

If A makes changes to a file, M completely refactors that file, and B make changes with a similar effect (but different form) to the new version, we can not implement the proposed behavior in a way that make sense, no matter how clever we are -- the left and right sides of the diff would show completely different "unchanged" lines. Although a sophisticated reviewer might be able to puzzle through this, it would no doubt be very confusing to a novice. We currently do this only in cases where the reasoning is completely obvious (the lines differ only by whitespace changes).

What we can do is automatically update the revision with the merge or rebase commit (in addition to the actual change) when you update a diff, so you can view current vs state-after-merge using the UI. This is probably not even terribly difficult. It would look something like this:

+------+ +----------------------------------------------------------------+
|  xx  | |alincoln merged abcdef12345.                                    |
|  xx  | |alincoln updated this revision to Diff #12345.                  |
| xxxx | +----------------------------------------------------------------+
+------+ |Fixed feedback blah blah blah...                                |
         |                                                                |
         +----------------------------------------------------------------+

And then the table would be all like:

Diff 1                                x -
Merge                                 o o
Diff 2                                o x
                              [View Diff]
epriestley renamed this task from Do not show changes from other commits when comparing two diffs in a revision to Update revisions with merge/rebase diffs so incremental changes can be shown.Apr 7 2012, 4:43 PM
epriestley triaged this task as Normal priority.
epriestley added a subscriber: epriestley.

We could also theoretically show 3-up diffs, where A appears on the left, the merge in the middle, and B on the right, or 4-up diffs with Base, A, Merge, B. This needs some significant UI work though.

chad changed the visibility from "All Users" to "Public (No Login Required)".Jul 3 2015, 4:35 AM