[Mono-list] newline and cvs

Martin Baulig martin@gnome.org
03 Mar 2002 20:12:26 +0100


"Jason Diamond" <jason@injektilo.org> writes:

> > Why bother with a tool? What a PITA. Why not just use the format that's
> > available on all platforms?
> >
> > Unix editors tend to have DOS compatility modes. I know it's simple to
> > have vim switch mode based on extension. Surely emacs can do something
> > similar?
> >
> > DOS editors tend NOT to have Unix compatilibity modes. Specifically:
> > VS.NET which I'm sure more than a few people here are using.
> 
> I'm using VS.NET and it doesn't give me a choice for how I want to save
> files. (I suspect I might be one of the offenders of this that spurred Paolo
> into writing his message.)

I think I'm also one of the culprits - I copied files from Windows to
Linux in some of my first commits.

> Is it possible to put a line in commitinfo to strip out carriage returns?
> That way there's no excuse for not forgetting. If not, I'll be sure to
> always run Pixel's one-liner on my files before checking them in.

That brings up the question whether to use windows or unix conventions
for all files - and I'm not sure whether unix files really work on
Linux. IMHO it'd be easier just to use Windows conventions for all
*.cs files - you won't even notice this on GNU/Linux if you're using a
decent editor.

However, a quick check showed me that we currently have 1591 files and
516 of them are using Windows conventions.:

$ find . -name \*.cs | wc -l
1591
$ find . -name \*.cs | xargs -i file {} | grep CRLF | wc -l
516

-- 
Martin Baulig
martin@gnome.org