Siva wrote:
Hi group,
A question.When i update my local copy,Idea shows certain files with interleaved blank lines.Ultraedit says they arent in DOS format.Is it a problem of unix/dos character encoding?
You might to say which files. Have you been using cygwin's cvs client?
Never mind, saw the files you mentioned and they all have garbage line endings (\r\r\n). The corresponding ,v files in the repository probably have dos linefeeds (\r\n) instead of the unix ones (\n) that cvs expects. *
If someone with commit rights runs dos2unix on the files or lets ultraedit do its thing, and checks them in with a windows client (not cygwin's), they should be ok from there. A script I use to clean up files is attached.
Btw, if you're using cygwin's default cvs client and are creating dos ended files do consider changing your setup to use cvsnt. Instructions to use cvsnt via cygwin are here:
http://www.dehora.net/journal/archives/000330.html
Bill de h�ra
* The files in cvs repository had a \r\n probably because an import from a unix type client didn't convert the \r\n to \n. As a result if a unix client checks them out you get a windows file and if a windows client checks them out you get the \n converted to a \r\n and the files end up having \r\r\n (if my memory serves me correctly, I get this stuff mixed up ;). I have no idea what the story is with a Mac (things probably just work).
#!/bin/sh
if [ "$#" != 2 ]
then
echo
echo
echo " fixclrf: recursively find files and convert them to unix line
endings"
echo
echo " Usage: fixclrf [dir] \"[exts]\" where,"
echo " [dir] is the directory to search from"
echo " [exts] is a string of file extensions (ie \".txt .sh\")"
echo
exit 1
fi
dir=$1
exts=$2
for ext in $exts
do
echo $ext
find $dir -name "*$ext" -print0 | xargs -0r dos2unix -U
done
