tags:

views:

246

answers:

2

I want to exclude a subdirectories by pattern in subversion because the development tool we are using is generating them. Getting the tool to generate the directories elsewhere is not an option. We don't want to edit the global-ignore property in ~/.subversion/config as it is difficult to maintain consistency with this. The directories we are trying to exclude look like this:

rootdir
  |-> dir1
       |-> dirToExclude
  |-> dir2
       |-> dirToExclude

I want to exclude dirToExclude in both dir1 and dir2. Can be done using an svn:ignore on rootdir instead of having to add the svn:ignore to both dir1 and dir2?

+3  A: 

Can be done using an svn:ignore on rootdir

No. svn:ignore specifically are not applied recursively but only on the current folder. Since each folder holds its own versioning information, nothing is propagated to subfolders. See The Red Book, Chapter 7., Properties, footnote 29.

This is actually quite unfortunate; I'd rather have a .htaccess-like property propagation myself.

Konrad Rudolph
A: 

You might consider another approach.

Typically, the desire to exclude subdirectories and/or files from source control is an indication that those subdirectories and/or files are in the wrong place--they should be moved out of the source tree. For example, if they are build output, then reconfigure your build tool/script to put them in a separate directory tree away from the source. If they are generated files, tell the relevant tool to generate them elsewhere.

Whatever the purpose of those files/subdirectories, you can probably reconfigure to move them out of the way. In the process, you simplify your life and probably resolve/ease some other issues as well.

If your particular tool makes that very hard to impossible, then it may be time to reevaluate the tool.

Best wishes.

Rob Williams