Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Why Eclipse Don't Use Existing EOL Format Of Some File?
Why Eclipse Don't Use Existing EOL Format Of Some File? [message #1844534] Thu, 16 September 2021 06:59 Go to next message
aleksandr den is currently offline aleksandr denFriend
Messages: 3
Registered: September 2021
Junior Member
I am new to Eclipse. I recently faced problem when I checked out some remote repo. I am using Eclipse in Windows. When I tried to commit back to the remote git repo, I saw whole file got changed when checking for difference. I solved it somehow using this link https://www.w3spot.com/2020/08/code-commit-from-windows-eclipse-shows-whole-file-changed-in-git.html . It was end of line issue. I was the only one using Windows & others were in Ubuntu.

Though problem got solved, I have a query. I want to understand why can't Eclipse maintain same EOL format for existing file. For example, I added a new function to an existing file. Eclipse would know that this file is using Ubuntu EOL format already. It should be able to use same format irrespective of the current operating system. Why it is not like that? Am I missing something?

[Updated on: Thu, 16 September 2021 07:05]

Report message to a moderator

Re: Why Eclipse Don't Use Existing EOL Format Of Some File? [message #1844638 is a reply to message #1844534] Sun, 19 September 2021 15:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Unfortunately those darned line endings are a constant source of problems. I think you are assuming that Eclipse doesn't maintain the EOL convention of the file; but it generally does exactly that. More likely you need to configure how git (EGit) handles line endings:

https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

Also a source of problem is if someone pushes files with Windows line endings into the repo which is generally expecting only files with Linux line endings. This is then quite hard to fix...

If you want more details about Eclipse's Git support, better to ask on the EGit forum:

https://www.eclipse.org/forums/index.php?t=thread&frm_id=48


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Why Eclipse Don't Use Existing EOL Format Of Some File? [message #1844786 is a reply to message #1844638] Sat, 25 September 2021 04:06 Go to previous message
aleksandr den is currently offline aleksandr denFriend
Messages: 3
Registered: September 2021
Junior Member
Thanks for replying. But I didn't change any EGit settings, I just updated the line delimiter & set it to Unix format though I am working in Windows laptop. And it solved the issue.

[Updated on: Sat, 25 September 2021 04:06]

Report message to a moderator

Previous Topic:eclipse workspace mapping delete my personal folders
Next Topic:How to install a JavaScript editor for Eclipse?
Goto Forum:
  


Current Time: Tue Apr 16 20:24:31 GMT 2024

Powered by FUDForum. Page generated in 4.45623 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top