Issue 1082 in tortoisegit: Autocrlf should be false by default

110 views
Skip to first unread message

torto...@googlecode.com

unread,
Feb 20, 2012, 2:36:20 PM2/20/12
to tortois...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1082 by borekb: Autocrlf should be false by default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

This is just a suggestion that crossed my mind but for a Windows software,
in the world of advanced text editors and IDEs, in the world where
basically no one is developing in Notepad, shouldn't autocrlf be false by
default?

Because many new users will just click through the installer which will
leave them with autocrlf = true and on standard Windows projects, that will
leave the project with some files with Windows-style, some other with
Unix-style endings.

torto...@googlecode.com

unread,
Feb 20, 2012, 6:06:29 PM2/20/12
to tortois...@googlegroups.com
Updates:
Status: ThirdPart

Comment #1 on issue 1082 by sstrickr...@gmail.com: Autocrlf should be false
by default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

TortoiseGit doesn't default AutoCrLf to true, it's msysgit (during
installation you are asked what you want and autocrlf is the default there).

torto...@googlecode.com

unread,
Mar 6, 2013, 10:25:20 PM3/6/13
to tortois...@googlegroups.com

Comment #2 on issue 1082 by tanza...@gmail.com: Autocrlf should be false by
default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

This is a religious issue, and you're unlikely to convince anyone either
way.

The rationale for false is: The source control system should not change
line endings. StackOverflow is very vocal in support of this. However,
the most highly-voted answers are from more than two years ago, when the
tooling was much more immature and often reported that every line had
changed. Git is much more mature on Windows today, and this should not be
a problem.

The rationale for true is: the Git repository should *always* be in LF.
This is the standard for cross-platform projects, this is the standard for
Github, and it's best if you follow the (de facto) standard. When you add
a new file to a project in Visual Studio, it will have CRLF line endings.
If autocrlf is false, then it will get committed as CRLF.

Msysgit discussed this issue five years ago, and decided on autocrlf=true.
Since both TortoiseGit and GitExtensions install Msysgit by default, this
affects the two most popular Windows GUI tools.
http://code.google.com/p/msysgit/issues/detail?id=21

Github is the 800-pound elephant in the Git hoisting space, and they
strongly advocate for autocrlf=true. Their own Windows client
creates .gitattributes with text=auto, which ignores autocrlf and forces
line endings to be converted.

Microsoft shipped the Visual Studio Git module with .gitattributes set to
crlf. However, they are preparing an update to change the default to
text=auto as well.
http://www.hanselman.com/blog/GitSupportForVisualStudioGitTFSAndVSPutIntoContext.aspx
(see comment from a Microsoft developer on February 6, 2013)

At this point, it's no longer a matter of your own preferences. *All* the
major Windows Git GUIs have decided that Git repositories should be
native-LF. If your repository is in CRLF format, causing mixed
line-endings when autocrlf=true, you can either do a commit that changes
all the files to LF, or set .gitattributes to make the repository format
crlf -- regardless of the autocrlf setting.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

torto...@googlecode.com

unread,
Mar 6, 2013, 10:32:43 PM3/6/13
to tortois...@googlegroups.com

Comment #3 on issue 1082 by tanza...@gmail.com: Autocrlf should be false by
default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

This is a religious issue, and you're unlikely to convince anyone either
way.

Msysgit discussed this issue five years ago, and decided on autocrlf=true.
They are unlikely to change.
http://code.google.com/p/msysgit/issues/detail?id=21

Bottom line is, the industry has come to a consensus that Git repositories
should have LF line endings. That includes Linus Torvalds, Msysgit,
Github, even Microsoft. (Microsoft does not support autocrlf, but they
will soon be releasing an update to set .gitattributes to auto.)

If you have a CRLF repository, you must assume that most Windows users will
have autocrlf=true, and this is unlikely to change. You can either follow
industry consensus and convert all your files over to LF, or
set .gitattributes to mark your repository as CRLF-native.

See:
http://stackoverflow.com/questions/170961/whats-the-best-crlf-handling-strategy-with-git

torto...@googlecode.com

unread,
Mar 13, 2013, 7:31:13 PM3/13/13
to tortois...@googlegroups.com

Comment #4 on issue 1082 by ch3co...@gmail.com: Autocrlf should be false by
default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

Can I close the issue? The setting is not made default by TortoiseGit.

torto...@googlecode.com

unread,
Mar 13, 2013, 8:00:12 PM3/13/13
to tortois...@googlegroups.com

Comment #5 on issue 1082 by borekb: Autocrlf should be false by default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

Yes.

torto...@googlecode.com

unread,
Mar 13, 2013, 8:14:04 PM3/13/13
to tortois...@googlegroups.com
Updates:
Status: Invalid

Comment #6 on issue 1082 by ch3co...@gmail.com: Autocrlf should be false by
default
http://code.google.com/p/tortoisegit/issues/detail?id=1082

(No comment was entered for this change.)

torto...@googlecode.com

unread,
Mar 13, 2013, 8:15:04 PM3/13/13
to tortois...@googlegroups.com
Updates:
Status: WontFix

Comment #7 on issue 1082 by ch3co...@gmail.com: Autocrlf should be false by
Reply all
Reply to author
Forward
0 new messages