Search code examples
svninheritanceignore

Inherit of svn:ignore properties in a subfolder doesn't work


Inherit of svn:ignore properties in a subfolder doesn't work.

As show in this screenshot, TortoiseSVN shows the following SVN properties for the folder ScenesAnim/z.SampleFolderStructure.z/Scenes, as well as showing that the file .Test.png is not being svn-ignored as one would expect.

| Property   | Value                                                                | Inherited From |
| svn:ignore | -R " *Feedback *.png *.zip *.rar *.wmv *.avi *.tga BackSceneSource " | ScenesAnim/z.SampleFolderStructure.z |

Why is it so? Is there an option to not to mark "Apply property recursively" flag under a properties window every time a create a subfolder to make it ignore the list again and again?

screenshot


Solution

  • The content of your svn:ignore property looks faulty. The -R part is the parameter telling the Subversion CLI executable to apply a command recursively, it does not belong in there. The double-quotes don't belong in there as well. Get rid of both and just put keep each of the exclusion masks in a single line, and you should be fine.

    Clarification: An exclusion mask is a term like *.tga. In your screenshot above, each of your exclusion masks already is on a single line. I just wanted to emphasize that this is in fact needed, because if all exclusion masks were combined on a single line, it would not work. Just get rid of the first two lines (the ones with -R and double quote) and the last one (double quote again).

    Concerning your second question:

    Is there an option to not to mark "Apply property recursively" flag under a properties window every time a create a subfolder to make it ignore the list again and again?

    If you are applying a property recursively it means that SVN will, from the current folder (let's call it CURRENT), iterate through all subfolders and explicitly set that property on every subfolder. Now, if you add a folder somewhere beneath the CURRENT folder, this new folder will not automatically inherit the property you recursively defined before. It's an unfortunate shortcoming of the svn:ignore property.

    Sidenote: Subversion 1.8 introduced "real" inheritable ignores with a reserved property called svn:global-ignores, which supposedly does exactly what you want (use the inherited ignore), but I don't have experience with that yet.