[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: fixing files committed with wrong eol-style

From: Yves Martin <ymartin59_at_free.fr>
Date: Wed, 14 Jul 2010 00:41:10 +0200

On Tue, 2010-07-13 at 09:44 -0500, Les Mikesell wrote:
> On 7/13/2010 8:57 AM, Geoff Worboys wrote:
> > Les Mikesell wrote:
> >> There are workarounds but you can't just expect things to
> >> work in general and pretend it is normal. And some of
> >> those workarounds may involve silently changing to the
> >> preferred local line endings - and if anything but subversion
> >> itself does that it becomes a change in every line when
> >> committed, making diffs useless.
> >
> > This may be true for some *nix systems/tools. But...
> >
> > For most modern (Windows) development software it is not a
> > matter of "workarounds". They simply process the files and
> > accept whatever line endings they find. Good editors will
> > automatically switch between CRLF, LF and CR EOL modes
> > according to what they find. They don't change the file
> > (unless asked) they change their own mode operation.
> >
> > If your developers all work with LF then there will be no
> > confusion and no need for workarounds. If anyone makes a
> > mistake and accidently commits a file with CRLF it is an
> > easy fix to resolve ... although most Windows software wont
> > care even if you don't bother to fix it.
>
> If you have to worry about mistakes, you are doing workarounds. What
> windows editor will create new files with LF endings by default?

Never-ending debate/troll...

The best option: CR-LF on Windows and LF on Linux and autoprops for
everyone !

To illustrate, worst examples I have seen:

* Cygwin installed with "LF" text file support
  to run "cvs" command line. Result: appending a new partial
  end-of-line at each commit - not fun !

* Unix scripts edited on Windows without eol-style.
  Result: on Linux, the shebang (#!) is invalid and the interpreter
  command is invalid: /bin/bash^M not found !

Best regards
Yves
Received on 2010-07-14 00:41:47 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.