> Why is the default for tfs clone autocrlf=false?
It is easier to quickly import everything if we treat it all as bytes,
rather than encoded characters with line endings. Pushing back to TFS
gets the same benefits. If all the files in the git repository are
bytewise identical to the ones in your working directory and the ones
in TFS (minus WIP), then git-tfs isn't going to do something
unexpected to the rest of your team when you push back. IIRC, line
endings can be a pain to deal with. For example, I recall breaking sln
files by giving them LF line endings, and breaking Gemfile.lock by
giving it CRLF line endings.
> Installing Git tool for Windows advises that the global be set to true. Most
> people install it this way.
> Even in the contributing to this project section it states that it should be
> set it to true.
Yes. If your project is entirely in git, autocrlf=true is the right
answer. I personally work across Linux, Mac, and Windows environments.
autocrlf=true generally makes that easier. I get fewer cases of a
"dirty" work tree that outputs nothing from `git diff -w`.
> But setting it to true when cloning from tfs, messes the pushes later i.e
> they get pushed with LF instead of CRLF, because the files get stored with
> LF in the git repo.
> Even leaving it to false has caused some problems (some conflict resolutions
> merges ended with LFs in tfs).
>
> Shouldn't the behavior be in sync with the behavior that git has and what
> users would expect, i.e normalizing the line endings before pushing to tfs
> (tfs being used mainly by windows users) and using the default setting that
> the user has in his global .gitconfig?
autocrlf=false makes git-tfs + git behave like TFS does. Because
git-tfs is essentially an alternative TFS client, I think this is a
reasonable default.
That said, if there's a better way to deal with it, that would be cool.
--
Matt