Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Uexpected CRLF conversion on clone
Uexpected CRLF conversion on clone [message #1823975] Sun, 05 April 2020 21:45 Go to next message
Rice Bauer is currently offline Rice BauerFriend
Messages: 34
Registered: August 2009
Member
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 13:42 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
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 09:20 Go to previous messageGo to next message
Rice Bauer is currently offline Rice BauerFriend
Messages: 34
Registered: August 2009
Member
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 09:21]

Report message to a moderator

Re: Uexpected CRLF conversion on clone [message #1824082 is a reply to message #1824063] Tue, 07 April 2020 14:48 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
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 16:59 Go to previous messageGo to next message
Rice Bauer is currently offline Rice BauerFriend
Messages: 34
Registered: August 2009
Member
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 18:56 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
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 20:57 Go to previous messageGo to next message
Rice Bauer is currently offline Rice BauerFriend
Messages: 34
Registered: August 2009
Member
Hey Thomas, good news again, thanks! :-)
Re: Uexpected CRLF conversion on clone [message #1824114 is a reply to message #1824093] Wed, 08 April 2020 06:45 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
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 09:56 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
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: Fri Apr 19 05:14:08 GMT 2024

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

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

Back to the top