Text encoding bug in merge?

43 views
Skip to first unread message

David Balažic

unread,
Mar 29, 2018, 11:09:03 AM3/29/18
to TortoiseSVN
HI!

Using:
TortoiseSVN 1.9.7, Build 27907 - 64 Bit , 2017/08/08 19:34:38

I did a merge of a change from another branch.

In the commit step, in the dialog, there was the top folder and one file listed as changed.
The folder had the mergeinfo recorded and the file had a few lines changed.

After commiting and checking the log on another computer, I noted that the mentioned file had two changes, not just the one shown in TortoiseMerge before the commit.

It turns out a nonascii charater a few lines above the other change was changed in its encoding.

Question: Why does TMerge not mark such a change as... a change? Is it depending on some settings of TMerge?


Additional info:

After that I edited the said file and changed that character back to UTF-8 encoding.
Now TMerge says:

---------------------------
TortoiseMerge
---------------------------
The text is identical, but the files do not match!

The following differences were found:

Encoding (ASCII, UTF-8)
---------------------------
OK  
---------------------------


The problem here is, that I commited a change I did not know it was there, as TM did not list it as a change.

Is this a bug?
If not, how to avoid it in future?

Regards,
David

David Balažic

unread,
Mar 29, 2018, 11:25:39 AM3/29/18
to TortoiseSVN
Additional information:

The line that was "broken" had no changes in the revision I was merging from, actually it did not even exist there.

Regards,
David

Stefan

unread,
Mar 29, 2018, 1:37:56 PM3/29/18
to TortoiseSVN


On Thursday, March 29, 2018 at 5:09:03 PM UTC+2, David Balažic wrote:
It turns out a nonascii charater a few lines above the other change was changed in its encoding.

Question: Why does TMerge not mark such a change as... a change? Is it depending on some settings of TMerge?


TortoiseMerge tries to detect the encoding of the whole file and uses that when saving. It does not do that line-by-line since that breaks more than using the whole file.
So, when saving the file with TMerge, it is saved with the detected encoding. You can see the detected encoding at the bottom right of TMerge.
And there you can also change the encoding if necessary.

It doesn't show those lines as changed since after loading with the detected encoding, those lines are not different anymore.
 

Additional info:

After that I edited the said file and changed that character back to UTF-8 encoding.
Now TMerge says:

---------------------------
TortoiseMerge
---------------------------
The text is identical, but the files do not match!

The following differences were found:

Encoding (ASCII, UTF-8)


Since you're using utf-8 encoding as the default, go to the TMerge settings dialog and check the box "Default to UTF-8 encoding".
Or you could add an .editorconfig file.
 
Stefan
Reply all
Reply to author
Forward
0 new messages