Skip to main content



      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 02:59 Go to next message
Eclipse UserFriend
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 03:05] by 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 11:50 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Why Eclipse Don't Use Existing EOL Format Of Some File? [message #1844786 is a reply to message #1844638] Sat, 25 September 2021 00:06 Go to previous message
Eclipse UserFriend
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 00:06] by Moderator

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


Current Time: Thu Jul 03 19:40:34 EDT 2025

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

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

Back to the top