From: José Fonseca <jrfonseca@tu...> - 2008-02-28 07:33:32
On a cross-platform source tree there are files that:
(a) should keep their unix LF line endings (e.g., shell scripts),
(b) should keep their DOS CR+LF line endings (.inf files), and
(c) should switch whatever the user prefers and have CR & CR+LF treated
indiscriminately (C/C++ source files).
For (c), we need git collaboration. Commiting line end changes is a
no-no, since it will create conflicts for all eternity.
In git it seems that the solution for that is core.autocrlf option
(http://www.kernel.org/pub/software/scm/git/docs/git-config.html ) and
My understanding from the manual page is that only people who are
developing on Windows should/must enable the this option by typing:
git config --global core.autocrlf true
and this will make git to convert *all text* files to CR+LF on
*checkout*, and to LF on *commit*. This means that:
- the repository generally keeps (c) files stored in LF, which means
that we are already screwed in several places.
- unix users don't need to set this option.
After, we may need to tweak core.autocrlf behavior a bit
disable the automatic CR+LF translation for files in case (a) and (b).
There is apparently a new option under development, core.safecrlf,
which prevents git to mistakenly do CR+LF conversion of binary files.
Get latest updates about Open Source Projects, Conferences and News.