Bug 567570 - Ignore changes does not work when checking out branch
Summary: Ignore changes does not work when checking out branch
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-03 14:08 EDT by Wim Jongman CLA
Modified: 2020-10-05 05:07 EDT (History)
1 user (show)

See Also:


Attachments
Ignore changes does not work (673.57 KB, video/mp4)
2020-10-03 14:08 EDT, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Jongman CLA 2020-10-03 14:08:54 EDT
Created attachment 284353 [details]
Ignore changes does not work

When there are issues when checking out a branch, the "Ignore changes" button does not work.
Comment 1 Thomas Wolf CLA 2020-10-04 12:40:38 EDT
Which EGit version?

Check the line endings. What are the line endings in the git index? What are the line endings on disk? What are the settings (core.eautocrlf/core.eol, .gitattributes) for this file?

I remember having had something similar a while back with a file that used mixed line endings. (Some lines CR/LF, some LF.) Whatever I did, the file always showed up as modified until I corrected the line endings.
Comment 2 Wim Jongman CLA 2020-10-04 12:58:51 EDT
(In reply to Thomas Wolf from comment #1)
> Which EGit version?

Eclipse EGit  5.9.0.202009080501-r	org.eclipse.egit

> 
> I remember having had something similar a while back with a file that used
> mixed line endings. (Some lines CR/LF, some LF.) Whatever I did, the file
> always showed up as modified until I corrected the line endings.


Yes this might be the same category. Eclipse/EGit think this file is not coded UTF-8 while in fact it is. I have to re-save it and commit to both branches before I can switch back an forth.

If you plan on looking at this, I can try to create a minimal project that exposes this. Let me know what you want to do.
Comment 3 Thomas Wolf CLA 2020-10-04 14:21:01 EDT
Check the encoding settings in Eclipse. Probably those say it was ISO-8859-1. *.properties files normally are not UTF-8. (Java Properties assume ISO-8859-1; and yes, Spring for instance has machinery to read UTF-8 properties files.)

Hmmm... I remember having looked at something similar not long ago... ah yes: that was bug 566097.

If you could provide a little demo git repo on Github containing an Eclipse project that shows that problem, that would be helpful. Would save me having to figure out which combination of settings exactly cause trouble.
Comment 4 Wim Jongman CLA 2020-10-05 05:07:50 EDT
It can take a while before I can work on this.