Soho Posted October 26, 2011 Report Share Posted October 26, 2011 I have set moved detection to 90% and minimum 1 line. I am wondering why Base64ToBin is not detected as moved in the following: Link to comment Share on other sites More sharing options...
manu Posted October 27, 2011 Report Share Posted October 27, 2011 Hi Soho, I guess that the 90% of similarity is too much restrictive for a difference as tiny as "Base64ToBin". Can you send to us both revisions to see exactly why is not recognizing it as a move? Regards, manu Link to comment Share on other sites More sharing options...
Soho Posted October 28, 2011 Author Report Share Posted October 28, 2011 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 More sharing options...
manu Posted October 28, 2011 Report Share Posted October 28, 2011 Hi Soho, The 100% of similarity is even more restrictive. Can you try with a lower value? Regards, manu Link to comment Share on other sites More sharing options...
Soho Posted November 1, 2011 Author Report Share Posted November 1, 2011 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 More sharing options...
manu Posted November 2, 2011 Report Share Posted November 2, 2011 Hi Søren, can you send to us the two revisions content in order to check if there's something wrong with the diff tool? Regards, Manu. Link to comment Share on other sites More sharing options...
psantosl Posted November 8, 2011 Report Share Posted November 8, 2011 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 More sharing options...
Soho Posted November 8, 2011 Author Report Share Posted November 8, 2011 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 More sharing options...
Borja Posted November 9, 2011 Report Share Posted November 9, 2011 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 Xdiff example with several moves 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 More sharing options...
psantosl Posted November 9, 2011 Report Share Posted November 9, 2011 A highly optimized evolution of the Levensthein distance if you wish Link to comment Share on other sites More sharing options...
Soho Posted November 14, 2011 Author Report Share Posted November 14, 2011 According to Borja's example it should work for me. I will double check if I made some stupid mistake in the setup. What settings did Borja use? Oh, and if I may be pedantic, it's spelled Levenshtein . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.