title: Is there a better way to handle svn:ignore lists for a project?
body: <p>For our projects, we avoid the use of svn <code>global-ignores</code> in users' svn configuration files because those svn settings are limited to the client and are not properties of the project.  We wanted a way to manage the ignored files in project subdirectories using something like <code>.gitignore</code> files.  I developed a simple scheme that uses <code>.svnignore</code> files combined with a script that (1) looks for <code>.svnignore</code> files in a directory tree and (2) updates the <code>svn:ignore</code> property on each directory in which a <code>.svnignore</code> file is found.  When someone updates the file, they just need to remember to run the script; we find this easier than manually managing the <code>svn:ignore</code> properties on directories.</p>
  
  <p>Here is the script:</p>
  
  <pre><code>#!/bin/sh
  # Syntax of the .svnignore file: like what "svn propset svn:ignore" accepts,
  # and in addition, lines in the .svnignore file that begin with a pound sign
  # (#) are ignored so that one can put comments in the file.
  
  find $1 -depth -name .svnignore | while read file ; do
    dir="`dirname $file`"
    egrep -v '^[  ]*#' $file | svn propset svn:ignore -F - $dir
    svn update $dir
    svn commit --depth=immediates -m"Updated list of ignored files." $dir $dir/.svnignore
  done
  echo "Done."
  </code></pre>
  
  <p>Here is an example of a <code>.svnignore</code> file accepted by this script:</p>
  
  <pre><code># WARNING: This .svnignore file is not understood by SVN directly.
  # WARNING: It is meant to be used in conjunction with our script in 
  # WARNING: trunk/project/scripts/svn-update-from-svnignore.sh
  autom4te.cache
  Makefile
  config.log
  config.status
  .deps
  include
  TAGS
  CTAGS
  *.o
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Is there a better way to accomplish the same thing?</li>
  <li>Are there any dangers in the approach or the script you see here?  </li>
  </ol>
  
  <p>Thanks for any tips.</p>