Page MenuHomePhabricator

Moved file is showing incorrectly in Differential
Closed, ResolvedPublic

Assigned To
Authored By
joshuaspence
Jan 4 2015, 9:50 AM
Referenced Files
F331049: Screen_Shot_2015-03-05_at_1.11.42_PM.png
Mar 5 2015, 9:14 PM
F331047: Screen_Shot_2015-03-05_at_1.10.59_PM.png
Mar 5 2015, 9:14 PM
F273324: before.png
Jan 22 2015, 7:56 AM
F273323: after.png
Jan 22 2015, 7:56 AM
F261218: D11193_collapsed
Jan 4 2015, 9:50 AM
F261216: D11193_expanded
Jan 4 2015, 9:50 AM

Description

In D11193, I am seeing the old file expanded and the new file collapsed.

D11193_expanded (744×1 px, 78 KB)

D11193_collapsed (744×1 px, 86 KB)

Revisions and Commits

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Differential.
joshuaspence added a subscriber: joshuaspence.

Do you have a way to reproduce this? I'm not totally sure that D11970 fixes this, it just fixes every case I was able to identify.

I could provide you with a raw diff if that helps?

Oh, I think this is related to the magic "fill in missing context" stuff we do, since downloading and then re-creating the diff doesn't reproduce the issue:

https://secure.phabricator.com/differential/diff/28850/

The sequence of commands you used to generate that was something like this?

$ git mv a b
$ git commit -m blah
$ arc diff HEAD^ --only

Yeah, that repro'd things:

https://secure.phabricator.com/differential/diff/28851/

This remains broken after D11970, but is hard to test because I think there is no raw diff input which can generate the internal diff which causes the issue.

I'm not sure that I understand...

If you do this:

$ git mv a b
$ git commit -m blah
$ git diff HEAD^ -M | arc diff --raw # <-- Not "arc diff"!

...you get this:

Screen_Shot_2015-03-05_at_1.10.59_PM.png (323×1 px, 36 KB)

If you do this for the last line:

$ arc diff HEAD^ --only

...you get this:

Screen_Shot_2015-03-05_at_1.11.42_PM.png (992×1 px, 74 KB)

The reason they're different is that that the arc diff version has been enhanced with synthetic metadata via ArcanistDiffParser->loadSyntheticData().

There's no valid plain-text diff which any diff program understands that represents "move + synthetic augment", so it's hard to unit test, since we can't easily encode it as a unit test input.

That is, the git diff output is this:

diff --git a/README b/README.moved
similarity index 100%
rename from README
rename to README.moved

What arc actually sends up is something like this:

diff --git a/README b/README.moved
similarity index 100%
rename from README
rename to README.moved
@@ blah blah @@
- each
- line 
- of
- the
- old
- file

...except it sends it up in a parsed format, and that isn't a valid git diff anyway.