views:

125

answers:

5

In TortoiseSVN 1.5.1 I've noticed a curious pattern. If I change one line in a versioned file and then view difference the diff will highlight not only the changed line but also the last line of the file (though the last line hasn't changed and the colors in the highlight display that correctly).

Is there any use of this curious highlighting of the last line?

+1  A: 

You could always check the last line to see if the file has changed. But I think you are right, pretty pointless :)

Daniel Elliott
+1  A: 

This is helpful, when the file has not been changed but the svn-metadata of the file have. When the diff highlights the last line without any previos change you can be sure that the file is unchanged and the metadata has changed.

PVitt
Wouldn't it be better to display a diff of metadata as well then?
Svish
+2  A: 

This could be a limitation of diff. Check if the file ends with a newline character.

GNU diff will mark incomplete lines (lines that are not terminated with a newline character) as changed, even if they have not because diff can't represent incomplete lines. See this diff doc

Some tools work around this limitation. Tortoise might not.

levinalex
+4  A: 

This bug was fixed in 1.5.7. See the changelog for details.

Stefan
+1  A: 

Besides updating Tortoise, I would recommend using SourceGear DiffMerge. Tell Tortiose to use an external Diff Viewer and give it a command line like: C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe /t1=%bname /t2=%yname %base %mine.

It'll look like Tortoise but work much better.

C-Pound Guru