Git line endings

27 views
Skip to first unread message

Krzysztof Koźmic (2)

unread,
Mar 30, 2010, 3:09:48 AM3/30/10
to Castle Project Development List
I'm starting a new thread for this, not to pollute the other
discussion.

I vote *for* frictionless working with Git. As discussed before I had
issues with files shown as modified just after I did clean clone. I
have this working now, but while fixing one thing, that introduced
another.
In repository we keep files with lf, and I work on Windows. When I add
a new file it gets added with crlf which leads to us having mixed
lines ending in the repository.

Worse, when I start editing lf file, it breaks ReSharper, which can't
handle them. Every refactoring either blows up my VS or ends up with
me having a file with mixed line endings. I then tell VS to convert
line endings to crlf so that I can work with it and with ReSharper,
and then change line endings back manually in Notepad++.

Hopefully I don't have to tell you what PITA that is.

So I'm for resolving these issues, by whatever means people more
experienced with Git than myself find best.

Krzysztof

On 30 Mar, 03:26, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:
> Yes, it can be changed at any time (not for the entire history of course,
> that would need history rewriting), it's not hard, seehttp://help.github.com/dealing-with-lineendings/
> <http://help.github.com/dealing-with-lineendings/>This was discussed not
> long ago and several people voted against autocrlf so it remains that way:http://www.mail-archive.com/castle-pro...@googlegroups.com/msg...
>
> <http://www.mail-archive.com/castle-pro...@googlegroups.com/msg...>
> Cheers,
> Mauricio

Julian Birch

unread,
Mar 30, 2010, 3:26:53 AM3/30/10
to castle-pro...@googlegroups.com
James Foster on the dotless project believes he has a solution. But
it requires co-ordination of everyone involved. I think the CRLF
setting has to be set to true on windows and auto on unix/mac.

J

> --
> You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
> To post to this group, send email to castle-pro...@googlegroups.com.
> To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.
>
>

John Simons

unread,
Mar 30, 2010, 3:31:05 AM3/30/10
to Castle Project Development List
Well since most committers(if not all) work in Windows, I vote to
turn CRLF to true.

Cheers
John

On Mar 30, 6:26 pm, Julian Birch <julian.bi...@gmail.com> wrote:
> James Foster on the dotless project believes he has a solution.  But
> it requires co-ordination of everyone involved.  I think the CRLF
> setting has to be set to true on windows and auto on unix/mac.
>
> J
>

Julian Birch

unread,
Mar 30, 2010, 3:31:26 AM3/30/10
to castle-pro...@googlegroups.com
Sorry, the unix setting is "input"

Morten Maxild

unread,
Mar 30, 2010, 5:09:35 AM3/30/10
to castle-pro...@googlegroups.com
The core.autocrlf serting is local. There is no way to propagate it
from upstream repo to downstream repo. This leads to confusion and
dirty commits in every git project i have worked with, and i have made
this mistake more than once.

It sounds good to have LF in the repo, and whatever the platform dev
desires in the working tree. That is true in win and input or false on
*nix. Haven't worked with mono, but using true on win have worked
great so far for me. Btw spark and fluentnh both are using false and
therefore has CRLF in repos, have anybody heard about problems
with that?

Sent from my iPhone

On 30/03/2010, at 09.31, Julian Birch <julian...@gmail.com> wrote:

> Sorry, the unix setting is "input"
>
> On Tuesday, March 30, 2010, Julian Birch <julian...@gmail.com>
> wrote:
>> James Foster on the dotless project believes he has a solution. But
>> it requires co-ordination of everyone involved. I think the CRLF
>> setting has to be set to true on windows and auto on unix/mac.
>>
>> J
>>

>> On Tuesday, March 30, 2010, Krzysztof Koźmic (2) <krzysztof@kozmic

Julian Birch

unread,
Mar 30, 2010, 8:14:00 AM3/30/10
to castle-pro...@googlegroups.com
My reading of the got config web page suggests that we could have a
repository-specific config file. Don't know anyone with experience of
trying this, though.

J

On Tuesday, March 30, 2010, Morten Maxild <mma...@gmail.com> wrote:
> The core.autocrlf serting is local. There is no way to propagate it from upstream repo to downstream repo. This leads to confusion and dirty commits in every git project i have worked with, and i have made this mistake more than once.
>
> It sounds good to have LF in the repo, and whatever the platform dev desires in the working tree. That is true in win and input or false on *nix. Haven't worked with mono, but using true on win have worked great so far for me. Btw spark and fluentnh both are using false and therefore has CRLF in repos,     have anybody heard about problems with that?
>
> Sent from my iPhone
>
> On 30/03/2010, at 09.31, Julian Birch <julian...@gmail.com> wrote:
>
>
> Sorry, the unix setting is "input"
>
> On Tuesday, March 30, 2010, Julian Birch <julian...@gmail.com> wrote:
>
> James Foster on the dotless project believes he has a solution.  But
> it requires co-ordination of everyone involved.  I think the CRLF
> setting has to be set to true on windows and auto on unix/mac.
>
> J
>

Mauricio Scheffer

unread,
Mar 30, 2010, 9:28:08 AM3/30/10
to Castle Project Development List
AFAIK it's possible with a .gitattributes file (which can be stored in
the repository, thus forcing everyone to its settings) which can be
something like:

*.cs crlf diff
*.csproj crlf diff
*.xml crlf diff
...

but that would force people on *nix and mac to have CRLF unless they
override it.

http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

--
Mauricio

On Mar 30, 9:14 am, Julian Birch <julian.bi...@gmail.com> wrote:
> My reading of the got config web page suggests that we could have a
> repository-specific config file.  Don't know anyone with experience of
> trying this, though.
>
> J
>
>
>
> On Tuesday, March 30, 2010, Morten Maxild <mmax...@gmail.com> wrote:
> > The core.autocrlf serting is local. There is no way to propagate it from upstream repo to downstream repo. This leads to confusion and dirty commits in every git project i have worked with, and i have made this mistake more than once.
>
> > It sounds good to have LF in the repo, and whatever the platform dev desires in the working tree. That is true in win and input or false on *nix. Haven't worked with mono, but using true on win have worked great so far for me. Btw spark and fluentnh both are using false and therefore has CRLF in repos,     have anybody heard about problems with that?
>
> > Sent from my iPhone
>

> > On 30/03/2010, at 09.31, Julian Birch <julian.bi...@gmail.com> wrote:
>
> > Sorry, the unix setting is "input"
>

> > On Tuesday, March 30, 2010, Julian Birch <julian.bi...@gmail.com> wrote:
>
> > James Foster on the dotless project believes he has a solution.  But
> > it requires co-ordination of everyone involved.  I think the CRLF
> > setting has to be set to true on windows and auto on unix/mac.
>
> > J
>

> > For more options, visit this group athttp://groups.google.com/group/castle-project-devel?hl=en.


>
> > --
> > You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
> > To post to this group, send email to castle-pro...@googlegroups.com.
> > To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/castle-project-devel?hl=en.

James Curran

unread,
Mar 30, 2010, 9:30:26 AM3/30/10
to castle-pro...@googlegroups.com
My choice would be CRLF endings because that the CORRECT way per the
ASCII standard (which predates Unix & Windows)

Truth,
James

Krzysztof Koźmic (2)

unread,
Mar 30, 2010, 9:41:47 AM3/30/10
to Castle Project Development List
does *any* committer write Castle code on something else than Windows?

On 30 Mar, 15:28, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:

Rafael Teixeira

unread,
Mar 30, 2010, 10:13:19 AM3/30/10
to castle-pro...@googlegroups.com
No Linux committer that I know.

But indeed in Linux/MacOS we normally use the Monodevelop IDE, that
works well with all tree common line endings(lf cr-lf and cr).
I'm quite sure Vim and Emacs, and derivatives, are also capable of
reading and maintaining cr-lf, if correctly configured.

So I think you can go ahead, and configure git for cr-lf, that we that
use multiple OSes won't suffer to keep using Castle, and even
customizing and sending patches.

Fun

Rafael "Monoman" Teixeira
---------------------------------------
"To be creative means to be in love with life. You can be creative
only if you love life enough that you want to enhance its beauty, you
want to bring a little more music to it, a little more poetry to it, a
little more dance to it."
Osho

2010/3/30 Krzysztof Koźmic (2) <krzy...@kozmic.pl>:

Mauricio Scheffer

unread,
Mar 30, 2010, 10:56:57 AM3/30/10
to Castle Project Development List
I applied github's recommended procedure and added a gitattributes
file to my fork: http://github.com/mausch/Castle.InversionOfControl/tree/crlf
Can anyone give it a try and see if it behaves correctly?

Cheers,
Mauricio

On Mar 30, 11:13 am, Rafael Teixeira <mono...@gmail.com> wrote:
> No Linux committer that I know.
>
> But indeed in Linux/MacOS we normally use the Monodevelop IDE, that
> works well with all tree common line endings(lf cr-lf and cr).
> I'm quite sure Vim and Emacs, and derivatives, are also capable of
> reading and maintaining cr-lf, if correctly configured.
>
> So I think you can go ahead, and configure git for cr-lf, that we that
> use multiple OSes won't suffer to keep using Castle, and even
> customizing and sending patches.
>
> Fun
>
> Rafael "Monoman" Teixeira
> ---------------------------------------
> "To be creative means to be in love with life. You can be creative
> only if you love life enough that you want to enhance its beauty, you
> want to bring a little more music to it, a little more poetry to it, a
> little more dance to it."
> Osho
>

> 2010/3/30 Krzysztof Koźmic (2) <krzysz...@kozmic.pl>:

SimoneB

unread,
Mar 30, 2010, 3:32:03 PM3/30/10
to Castle Project Development List
Isn't core.autocrlf=true made for this exact reason?

SimoneB

unread,
Mar 30, 2010, 3:33:30 PM3/30/10
to Castle Project Development List
Ouch, sorry, google showed me no replies to this thread until I
submitted mine.

On Mar 30, 9:32 pm, SimoneB <simone.bus...@gmail.com> wrote:
> Isn't core.autocrlf=true made for this exact reason?
>

Mauricio Scheffer

unread,
Apr 9, 2010, 3:55:19 PM4/9/10
to Castle Project Development List
Krzysztof and I have been running a couple of tests today.
The .gitattributes solution didn't work out.
So these are the solutions I can think of:

* setting core.autocrlf to true, or
* converting all files with LF (like AbstractHandler.cs) to CRLF so
they're stored as CRLF in the repo

Does anyone have any other solution?

Previous thread about this:
http://groups.google.com/group/castle-project-devel/browse_thread/thread/de27675cd7f08259

For reference: spark uses core.autocrlf false, mvccontrib uses true,
and FNH uses false

Cheers,
Mauricio

Ken Egozi

unread,
Apr 9, 2010, 4:03:05 PM4/9/10
to castle-pro...@googlegroups.com
my personal history with git tells me that autocrlf=false works better - as it has the lowest surprise element.
so I'd vote for setting that, and redoing all files to CRLF (we can have the "shortest script" contest. I bet that BOO would win)


--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.




--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.idcc.co.il - הכנס הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם

Ayende Rahien

unread,
Apr 10, 2010, 4:54:20 AM4/10/10
to castle-pro...@googlegroups.com
+1

rod

unread,
Apr 10, 2010, 6:18:48 PM4/10/10
to Castle Project Development List

On Apr 9, 9:55 pm, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:


> Krzysztof and I have been running a couple of tests today.
> The .gitattributes solution didn't work out.
> So these are the solutions I can think of:
>
> * setting core.autocrlf to true, or

.. and converting all text files in repo as LF endings.

Repo (LF) --- autoclrf = true --> Client Windows CRLF
Repo (LF) --- autoclrf = input --> Client Linux LF

Good thing is to rewrite history after importing from SVN

I've made some recipe about it but in polish here http://rod.42n.pl/?p=75

Here is translation
http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http%3A%2F%2Frod.42n.pl%2F%3Fp%3D75%23more-75&sl=pl&tl=en

Craig Neuwirt

unread,
Apr 10, 2010, 7:28:08 PM4/10/10
to castle-pro...@googlegroups.com
+1 and
git config core.filemode false
Reply all
Reply to author
Forward
0 new messages