X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_46 X-Spam-Check-By: sourceware.org Date: Sat, 20 Dec 2008 17:29:34 +0100 From: Spiro Trikaliotis To: cygwin AT cygwin DOT com Message-ID: <20081220162934.GY14886@trikaliotis.net> Mail-Followup-To: cygwin AT cygwin DOT com References: <877i5wlwc3 DOT fsf AT mcbain DOT luannocracy DOT com> <20081219090531 DOT GV14886 AT trikaliotis DOT net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-SA-Exim-Connect-IP: 87.163.248.253 X-SA-Exim-Mail-From: an-cygwin AT spiro DOT trikaliotis DOT net Subject: Re: Rationale for line-ending recommendation? X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000) X-SA-Exim-Scanned: Yes (on mail.trikaliotis.net) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hello Gary, * On Fri, Dec 19, 2008 at 03:42:34AM -0600 Gary R. Van Sickle wrote: > > From: Spiro Trikaliotis [...] > > Oh, and Subversion is problematic, too. Because the SVN > > developers decided to handle line endings on their own using > > libapr, opening files in binary mode and reading and writing > > CR, LF or CR/LF on their own, > > This is the right way to do things... I hope you are ironic here, right? > > on Cygwin, SVN is hard-coded to > > *nix line endings. This is not nice. Note that this approach > > will also fail badly if you mount parts of your system in > > textmode, and parts in binmode. > > > > Because of this, I am using an SVN version which I compiled > > myself with a patched libapr. > > > > ...I'm not following this. Are you talking about the SVN repository, or the > clients, or...? What's the issue? You are right, I was not specific enough. I never tested an SVN server on Cygwin, thus, I can only talk about the client side. If you check out some files which are set to CRLF=native, Cygwin's SVN checks them out with LF line ending (as SVN handles the endings on its own, and libapr tells it that Cygwin == Unixoid == LF). Now, if you edit a file of this using some tool that 1. does not have problems with the LF endings, but 2. generates CR/LF endings on new lines (like, for example, MSVC does, but also some other tools) then SVN cannot check in that file. It complains that the file has "mixed line endings". Yes, that's right, but why does SVN care? Even commands like "svn diff" behave erratically. You have to use d2u in order to get this file checked in. This is really annoying. Note: In my opinion, this is clearly an SVN/libapr problem, not a Cygwin problem. > I know CVS had some problems with the > dreaded \n/\r\n issue back in the day, but I wasn't aware of similar > Subversion issues. The CVS issue was a mere cosmetical one, while the SVN one is a real show-stopper, IMHO. > > Other than that, I never had any problems with the CR/LF line endings. > > Bash has some known problems in this area, but there's a Cygwin-specific fix > (that unfortunately is off by default) which hopefully will get accepted > upstream sometime in the next century. But this fix is in bash, right? So, it does not have a CR/LF issue in Cygwin, as I said. ;) > > Thus, many programmers do not care about the "right" mode. > > Well, better stated, they assume they can treat all files - text, > executables, jpegs, whatever - as if they were Unix-formatted text files. > Of course, they're not, hence problems ensue. Well, it is hard to test something against problems that are unlikely to occur at all in your environment, right? Of course, you can generate artificial test cases for this. However, if you think about generating these test cases, chances are high you would not do it wrong in the first place. Thus, while I think it is annoying that some tools have CR/LF problems, I can understand WHY this happens. Best regards, Spiro. -- Spiro R. Trikaliotis http://opencbm.sf.net/ http://www.trikaliotis.net/ http://www.viceteam.org/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/