Bug: TortoiseUDiff creates way too large diff when only adding lines

35 views
Skip to first unread message

Matthias Kläy

unread,
Jan 23, 2018, 2:46:01 AM1/23/18
to TortoiseSVN
Creating 'AddedComplete.diff' for 'AddedComplete.cs' compared to 'OriginalComplete.cs' results in a diff that covers 100% of the content even though only a few lines have been added.

Same situation with '*Stripped.*' (stripped for easier handling / easier reproducing the issue).

As a result, .diff is unnecessarily large, in this case 171 KB, containing all lines of 'AddedComplete.cs' as well as 'OriginalComplete.cs'.

mklaeysw...@gmail.com

unread,
Jan 23, 2018, 4:08:24 AM1/23/18
to TortoiseSVN
Holy moly, is this complicated to attach files... Either, let me know how to do this easily, or, contact me so I can send them. Otherwise, never mind, I just wanted to give feedback in an attempt to make TortoiseSVN even better...

Stefan

unread,
Jan 23, 2018, 12:19:12 PM1/23/18
to TortoiseSVN
There's a blue text "Attach a file" which you can click. Don't know how to make that easier.

Also, the diff format is standardized so other tools can use it as well, so we can not change that without breaking the official format.

 

mklaeysw...@gmail.com

unread,
Jan 25, 2018, 8:28:33 AM1/25/18
to TortoiseSVN
Well, I cannot see a "Attach a file" field, probably since I am not member of this list.

But I have found the root cause of the issue: The lines of the original files are <LF> terminated, whereas I added <CR><LF> terminated line. Seems like UDiff cannot cope with mixed line endings. (Of course a file shouldn't do this, but apparently this may happen.)

Stefan

unread,
Jan 25, 2018, 4:18:40 PM1/25/18
to TortoiseSVN


Well, I cannot see a "Attach a file" field, probably since I am not member of this list.

But I have found the root cause of the issue: The lines of the original files are <LF> terminated, whereas I added <CR><LF> terminated line. Seems like UDiff cannot cope with mixed line endings. (Of course a file shouldn't do this, but apparently this may happen.)

If you hold down the shift key when you click on the "create unified diff" menu entry (or whatever command you used in TSVN), then a dialog will first show up where you can specify whether you want to ignore EOL changes in the diff.

mklaeysw...@gmail.com

unread,
Feb 8, 2018, 8:41:34 AM2/8/18
to TortoiseSVN

> If you hold down the shift key when you click on the "create unified diff" menu entry (or whatever command you used in TSVN), then a dialog will first show up where you can specify whether you want to ignore EOL changes in the diff.

Hmm... In TortoiseMerge, I only have a "create patch file" button. I remember that there was a "create unified diff" button, but that has disappeared in a recent version.

When clicking on "create patch file" with [Shift] or [Ctrl] or [Alt], nothing happens differently than just clicking on if, I do not get an additional option regarding EOL.

Note that my settings have "ignore line endings (recommended)" enabled. But I guess this only applies to the TortoiseMerge view, not TortoiseUDIff. Also, when selecting [TortoiseSVN > Settings > TortoiseUDiff], there is no EOL related setting there.

I know that I can select [TortoiseSVN > Create Patch...] and then "Show differences as unified diff". Same with [SVN Commit...]. But, both these options only work with a specific file. But when I want to create a diff of two different files (e.g. A.txt and B.txt), then [TortoiseSVN > Diff...] brings up TortoiseMerge, and there I no longer find an option to "create unified diff".

Stefan

unread,
Feb 10, 2018, 3:58:19 AM2/10/18
to TortoiseSVN


On Thursday, February 8, 2018 at 2:41:34 PM UTC+1, (unknown) wrote:

> If you hold down the shift key when you click on the "create unified diff" menu entry (or whatever command you used in TSVN), then a dialog will first show up where you can specify whether you want to ignore EOL changes in the diff.

Hmm... In TortoiseMerge, I only have a "create patch file" button. I remember that there was a "create unified diff" button, but that has disappeared in a recent version.

So you're creating the patch file from TMerge. There's no option to ignore EOLs for that yet.
I've now added that option as a checkbox in the file-save dialog (r28102).

you can try a nightly build tomorrow if you like:
https://nightlybuilds.tortoisesvn.net/latest/

Stefan

mklaeysw...@gmail.com

unread,
Feb 12, 2018, 10:05:08 AM2/12/18
to TortoiseSVN
Am Samstag, 10. Februar 2018 09:58:19 UTC+1 schrieb Stefan:
>
>
>
> So you're creating the patch file from TMerge. There's no option to ignore EOLs for that yet.
> I've now added that option as a checkbox in the file-save dialog (r28102).
>
> you can try a nightly build tomorrow if you like:
> https://nightlybuilds.tortoisesvn.net/latest/
>
> Stefan

Stefan, I confim that the lasted implementation fixes this issue.
Thanks, this discussion can be closed.
Viele Grüsse, Matthias
Reply all
Reply to author
Forward
0 new messages