Re: CRLF, LF ... CR ?

2012-09-27 Thread Jens Bauer
Hi Junio and David. Rule is in fact quite simple. If it's a text-file and it contains a LF, a CRLF or a CR, then that's a line-break. :) -So everywhere a LF is checked for, a CR should most likely be checked for. Usually, when checking for CRLF, one is looking for the LF. If a CR precedes the LF

Re: CRLF, LF ... CR ?

2012-09-26 Thread Junio C Hamano
David Aguilar writes: > That said, perhaps the "autocrlf" code is simple enough that it > could be easily tweaked to also handle this special case,... I wouldn't be surprised if it is quite simple. We (actually Linus, IIRC) simply declared from the get-go that it is not worth spending any line

Re: CRLF, LF ... CR ?

2012-09-26 Thread Jens Bauer
Hi David and Junio. Woops, that's what happens when deleting a block of lines in a message... The CR/LF/CRLF implementation depends a lot on if git is reading a stream or reading from memory. I'd like to correct the last line to read... Worst case is, if a file contains mixed CR, LF and CRLF, s

Re: CRLF, LF ... CR ?

2012-09-26 Thread Jens Bauer
Hi David and Junio. At first, I was planning to reply that I'd probably not be qualified for that. But to tell the truth, I have been writing a lot of CR/LF/CRLF code throughout the years, so maybe I could do it. Unfortunately, I have to go slow about programming, because I burned myself out a n

Re: CRLF, LF ... CR ?

2012-09-26 Thread David Aguilar
On Thu, Sep 13, 2012 at 9:51 PM, Junio C Hamano wrote: > David Aguilar writes: > >> git doesn't really even support LF. > > At the storage level that is correct, but the above is a bit of > stretch. It may not be "support", but git _does_ rely on LF when > running many text oriented operations (

Re: CRLF, LF ... CR ?

2012-09-13 Thread Junio C Hamano
David Aguilar writes: > git doesn't really even support LF. At the storage level that is correct, but the above is a bit of stretch. It may not be "support", but git _does_ rely on LF when running many text oriented operations (a rough rule of thumb is "does 'a line' in a file matter to the ope

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jens Bauer
Hi David. Thank you for the information. I am not the one to decide whether or not this should be a built-in feature; I'm only a plain user. :) My personal opinion: If it was a built-in feature, people all over the World would not be getting into trouble with it. I've seen on the net, that even

Re: CRLF, LF ... CR ?

2012-09-13 Thread David Aguilar
On Thu, Sep 13, 2012 at 8:09 AM, Jens Bauer wrote: > Hi everyone. > > I'm quite fond of git, and have used it for a while. > Recently, I've started making printed circuit boards (PCBs) using an > application called OsmondPCB (for Mac), and I'd like to use git to track > changes on these. > This

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jens Bauer
Hi Johannes. I've changed... tr '\\r' '\\n' ...to... tr '\\15' '\\12' ...As you are right in that it is more correct. (Then in theory, it would be portable). [I once came across tftpd, tried compiling it on a Mac, but it failed to work, because \r and \n were swapped on the comp

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jens Bauer
Hi Jeff and Drew. Excellent. I now removed the repository from the server, removed it from my gitolite.conf, added it to gitolite.conf, re-initialized and it works. git diff shows what I wanted. Thank you *very* much for making my dream come true. :) -And thank you all for all the hard work you'

Re: CRLF, LF ... CR ?

2012-09-13 Thread Johannes Sixt
Am 13.09.2012 17:53, schrieb Jens Bauer: > Hi Jeff and Drew. > > Thank you for your quick replies! :) > > The diffs look nasty yes; that's my main issue. > It can be worked around in many ways; eg a simple (but time consuming) way: > $ git diff mypcb.osm >mypcb.diff && nano mypcb.diff > > -It'd

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jeff King
On Thu, Sep 13, 2012 at 08:17:20PM +0200, Jens Bauer wrote: > In my home directory, I have a .gitconfig file, here's the interesting part: > [core] > editor = nano > excludesfile = /Users/jens/.gitexcludes > attributesfile = /Users/jens/.gitattributes > > [filter "cr"] >

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jens Bauer
Hi Jeff and Drew. I've been messing a little with clean/smudge filters; I think I understand them partly. Let's call the file I have on the server that have line endings, "mypcb.osm". If I clone the project, and do the following... $ cat mypcb.osm | tr '\r' '\n' I can read the file in the term

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jens Bauer
Hi Jeff and Drew. Thank you for your quick replies! :) The diffs look nasty yes; that's my main issue. It can be worked around in many ways; eg a simple (but time consuming) way: $ git diff mypcb.osm >mypcb.diff && nano mypcb.diff -It'd be better to just pipe it into a regex, which changes CR to

Re: CRLF, LF ... CR ?

2012-09-13 Thread Erik Faye-Lund
On Thu, Sep 13, 2012 at 5:34 PM, Drew Northup wrote: > On Thu, 2012-09-13 at 17:09 +0200, Jens Bauer wrote: >> Hi everyone. >> >> I'm quite fond of git, and have used it for a while. >> Recently, I've started making printed circuit boards (PCBs) using an >> application called OsmondPCB (for Mac),

Re: CRLF, LF ... CR ?

2012-09-13 Thread Jeff King
On Thu, Sep 13, 2012 at 11:34:50AM -0400, Drew Northup wrote: > > I've read that git supports two different line endings; either CRLF or LF, > > but it does not support CR. > > Would it make sense to add support for CR (if so, I hereby request it as a > > new feature) ? > > Even if Git can't do

Re: CRLF, LF ... CR ?

2012-09-13 Thread Drew Northup
On Thu, 2012-09-13 at 17:09 +0200, Jens Bauer wrote: > Hi everyone. > > I'm quite fond of git, and have used it for a while. > Recently, I've started making printed circuit boards (PCBs) using an > application called OsmondPCB (for Mac), and I'd like to use git to track > changes on these. > Thi