Jump to content

Moved detection


Soho

Recommended Posts

I guess that the 90% of similarity is too much restrictive for a difference as tiny as "Base64ToBin".

The Base64ToBin project definition is completely unchanged. Event with 100% similarity I would expect a move detector to find the new location, but I am not completely aware how the move detector algorithm determines matches.

Link to comment
Share on other sites

The 100% of similarity is even more restrictive. Can you try with a lower value?

It IS lower. What I wrote that, even if I set it to 100% I would expect it to find it, since they are 100% similar.

My setting IS lower, but should it matter, when the blocks are 100% identical?

Link to comment
Share on other sites

Hi there,

Manu, you can reproduce it with a .sln file just renaming an entry... But if I remember correctly move detection is better finding moves with more than one line...

What we do down here with .resx (not sure if doable with .sln) is to sort the file with a script prior to merging and diffing...

Link to comment
Share on other sites

I suppose you could make your move detection algorithm a bit more subtle. How about a definition like this:

A section of lines is moved if the following is true:

The Levenshtein distance to any other section in the same file is higher than some threshold (avoiding marking redundant text as moved).

The Levenshtein distance to another section in the other file is lower than some threshold.

Only one matching section is found in the other file.

If performance is a problem, the above algorithm is a standard dynamic programming problem.

Link to comment
Share on other sites

Hi Søren,

I have checked it with a similar case and it works correctly, as you can see:

Xdiff example with just one move

post-13-0-61226300-1320870770_thumb.png

Xdiff example with several moves

post-13-0-18969400-1320870785_thumb.png

Can you send to us your files in order to try to reproduce your problem locally?

We already use a variant of the Levensthein distance in order to detect the lines that have been moved.

Regards

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...