My thoughts as an enterprise Java developer.

Tuesday, October 02, 2007

Converting .cvsignore file to Subversion svn:ignore property

If you have converted a cvs repository to a Subversion repository and need to convert .cvsignore files to subversion svn:ignore properties then the following script should be useful to you. Note that it probably doesn't handle spaces in filenames.


find . -name ".cvsignore" -print | sed "s/\/.cvsignore//" | tee ignoredirs.txt

for i in `cat ignoredirs.txt`
echo Processing $i/.cvsignore
svn propset svn:ignore -F "$i/.cvsignore" "$i"
svn remove "$i/.cvsignore"



Anonymous said...

I suspected that there was such a trick, and thanks for showing it.

You can also use

-exec dirname '{}' ';'

on the find command to trim it down to just the directory names.

The only suggestion, as far as the spaces problem is concerned, is to translated the blanks into 'illegal characters' and then strip them again when they come out of the for loop.

tr ' ' '#' | tee ignoreddirs.txt

for i ...
dir=`echo $i | tr '#' ' '`

FOLDOC said...


... | while read i

instead of a temporary file.