Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Uexpected CRLF conversion on clone
Uexpected CRLF conversion on clone [message #1823975] Sun, 05 April 2020 17:45 Go to next message
Eclipse UserFriend
Hi there,

again, I'm on a Windows 10 machine with Eclipse 2020-03 and a .gitattributes with only this very simple line:
* text=auto


My gitconfig (system level) contains the following entry:
[core]
	autocrlf = input


Inside my repo, the text files contain LF line endings.

So, what I'd expect is that no line ending conversion happens on checkout and clone. That is also what Git for Windows does and what I read from here: https://git-scm.com/docs/gitattributes.
And by the way, for the checkout command, this is also what Eclipse does, so if I checkout an old commit that doesn't contain a certain text file and then checkout the latest commit again, I got LFs in the working directory.

However, if I perform a clone via "File > Import > Projects from Git...", my text files are checked out with CRLF line endings.

Can anybody confirm that this is undesired behaviour?

Regards
Rice
Re: Uexpected CRLF conversion on clone [message #1824012 is a reply to message #1823975] Mon, 06 April 2020 09:42 Go to previous messageGo to next message
Eclipse UserFriend
Where is your system level gitconfig located? If you open in Eclipse Preferences->Team->Git->Configuration, System tab, does it show the core.autocrlf=input setting?
Re: Uexpected CRLF conversion on clone [message #1824063 is a reply to message #1824012] Tue, 07 April 2020 05:20 Go to previous messageGo to next message
Eclipse UserFriend
Yes, it does. The file is here: C:\Program Files\Git\etc\gitconfig
I also got Git for Windows 2.24.0.windows.2, which no longer has two locations.

[Updated on: Tue, 07 April 2020 05:21] by Moderator

Re: Uexpected CRLF conversion on clone [message #1824082 is a reply to message #1824063] Tue, 07 April 2020 10:48 Go to previous messageGo to next message
Eclipse UserFriend
Ok, so it's not that. I don't have a Windows machine, so I can't really test the core.autocrlf = input behavior on cloning. I suggest you create a bug report, best with a little example repo attached (or at Github) with which one can reproduce this. I'll then ask EGit developers who are using Windows to take a look.

Also, does this occur only on Import->Projects from Git, or also when you simply clone the repo in the Git repositories view and then examine the file in the working tree?
Re: Uexpected CRLF conversion on clone [message #1824088 is a reply to message #1824082] Tue, 07 April 2020 12:59 Go to previous messageGo to next message
Eclipse UserFriend
I filed the following bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=561877

And it's the same behaviour when cloning from the Git repo view.
Re: Uexpected CRLF conversion on clone [message #1824090 is a reply to message #1824088] Tue, 07 April 2020 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Thanks. In the meantime I found the cause. It is a bug in JGit, will fix soon.
Re: Uexpected CRLF conversion on clone [message #1824093 is a reply to message #1824090] Tue, 07 April 2020 16:57 Go to previous messageGo to next message
Eclipse UserFriend
Hey Thomas, good news again, thanks! :-)
Re: Uexpected CRLF conversion on clone [message #1824114 is a reply to message #1824093] Wed, 08 April 2020 02:45 Go to previous messageGo to next message
Eclipse UserFriend
Bug fix is pending review in Gerrit. Git has just too many ways to set line-ending options.
Re: Uexpected CRLF conversion on clone [message #1827836 is a reply to message #1824114] Mon, 25 May 2020 05:56 Go to previous message
Eclipse UserFriend
Should be fixed in EGit nightly now. Fix will be in the upcoming EGit 5.8.0 (ETA: 2020-06-17), too.
Previous Topic:Binary file detection via gitattributes not working ?!
Next Topic:JGit
Goto Forum:
  


Current Time: Wed Jul 23 15:56:41 EDT 2025

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

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

Back to the top