Re: crlf with git-svn driving me nuts...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 17, 2008 at 11:09:12AM +0100, Nigel Magnay wrote:
>
> Maybe it isn't so bad - all
> svn projects probably *ought* to be using eol=native, but it isn't
> default; 

If you want to have native EOL for each platform then you have to do
this conversion, but it should be applied to only to text files.  So,
the question is how can a VCS know what file is text and what is not.
CVS considers everything what you check-in as text by default. If you
want to put a binary file, you have to use -kb flag, otherwise your file
may be damaged. People tend to be forgetful and some lose their data in
this way. So team SVN team decided to stay on the safe side and put
everything as is, because if you forget to set eol=native, you do not
lose anything and you can set eol=native later. Unfortunately, now SVN
users forget to set eol=native a way too often. So, IMHO, Git approach
based on heuristic is much better when most of stored files are text.

> so maybe it's just easier to coax those projects into fixing
> their svn repos (but of course it's not really an issue for them, so
> it might be a bit of a hard sell).

If they care about support different platforms then it _is_ issue
for them too. On the other hand, if everyone uses Windows with CRLF,
you can do that with Git too just by setting autocrlf=false.

> 
> Yes, in the sense that git is primarily a *nix tool, so it treats LF
> as canon

and perhaps even more important, it is written in C and where LF has
always been considered as EOL since the first Hello-World program was
written in C:

   printf("Hello world!\n");
-----------------------^^

So, naturally LF is considered as EOL inside of Git. Actually, CVS does
so, and even SVN does if you set eol=native.

> and CRLF as somehow 'stupid' (I.E you could make an equally
> valid argument for the reverse position, it just depends on your
> perspective ;-)) ;

There is no good technical reason to have two symbols as the end-of-line
marker instead of one. Most programs on Windows just remove CR when read
from a file and then adding it back before LF when writing it back. So,
CR is clearly redundant.

Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux