info-cvs
[Top][All Lists]
Advanced

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

Re: DOS EOL pollution in repository


From: David L. Martin
Subject: Re: DOS EOL pollution in repository
Date: Thu, 8 Mar 2001 00:35:47 -0600

> > I'm tempted to put in a commit
> > filter that rejects text files with DOS EOL's.
> 
> Sounds like a good thing to do in addition.  My suggestions will
> make life easier for people, but this is what'll enforce your
> policy.
> 
I've attached a perl script callable from commitinfo
that rejects commits of certain file types if any line
in the file ends in ctrl-M.

This script contains an explicit list of end of filename
matching criteria to ascertain whether a file is an
ASCII file.  (e.g. .java$, .txt$, .html$, etc.) and should
be checked for lines ending with ctrl-M.  (You
certainly would *not* want to run this check on
a binary file.)

Commented out from the script is an alternative
"automatic" way to determine whether the file
is ASCII using the Unix file command.  I haven't
thoroughly tested it, but I've found that if it returns
a match of ":.*text" or ":.*script", it is likely an
ASCII file.

Hope this helps,
David Martin


Attachment: commit_prep.pl
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]