in https://secure.phabricator.com/phriction/diff/328/?l=18&r=19:
It reports line 73 as "moved from line 73," which is... not technically accurate.
I think it had some white-space removed from it's end.
avivey | |
Apr 21 2015, 6:41 PM |
F6225231: Screen Shot 2019-02-20 at 5.20.57 AM.png | |
Feb 20 2019, 2:15 PM |
F377985: pasted_file | |
Apr 21 2015, 6:41 PM |
in https://secure.phabricator.com/phriction/diff/328/?l=18&r=19:
It reports line 73 as "moved from line 73," which is... not technically accurate.
I think it had some white-space removed from it's end.
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | epriestley | T9379 Build Phriction v3 | ||
Open | None | T7878 strange "moved from" signal in [Phriction] diff |
I think the root cause for this is a bit complicated to explain, but basically we try to match this as a move:
+ Moved line 1 Unchanged line 2 + Moved line 3
This lets us detect moves if there's something like a "}" in the middle of the block and the old code happened to also have that same common line.
However, I think we're currently detecting unchanged lines as valid parts of a block even if they aren't surrounded by moved lines, so we do something like this:
Unchanged line 1 Unchanged line 2 + Moved Line 3
And incorrectly decide that's a perfectly acceptable three-line block of moved code.
There's a bunch of test coverage for this so it's a pretty straightforward fix.
I think it had some white-space removed from its end.
This is somewhat obscured in the screenshot, but is the key to the behavior:
We normally don't detect copies on lines that haven't changed, and don't detect copies from lines that are different. But whitespace-only changes are a special case that skips past both of these rules.
It's not immediately obvious to me how to fix this without breaking anything else, but I'm also not having a particularly good brain day today.