Given a Subversion project where certain patterns are always to be ignored,
*.log
*.idx
and certain patterns are ignored only in, e.g., the project root,
*.out
how can I maintain both lists in a single svn:ignore property?
To maintain the project-wide list, I would recursively apply the root folder’s svn:ignore property whenever I change it. But that would include patterns which should only be ignored in the root.
If I don’t apply it recursively, though, then the other patterns will not be ignored in subfolders.
UPDATE: If you’re used to Mercurial (like I am), you might suggest putting paths in the root’s ignore list, like
*/*.idx
or
*\*.idx
Neither of these works for me in the latest Subversion.
There are two mechanisms to work with ignores in Subversion:
global-ignoresin the subversion configuration. Applies globally to all the projects. Generally speaking defining too much of global-ignores is a bad thing.svn:ignoreproperty. By settingsvn:ignoreproperty one can define list of files or folders ignored in the directory for which this property is defined.Both global ignores and
svn:ignoreproperty work not with regular expressions but use patterns complying to the fnmatch pattern syntax. Which defines only three types of the wild cards?,*, and[]. You may play withlsto feel how these patterns work.Subversion properties may be set recursively. This will work for
*.idxand*.logfiles:Create a file
ignoreswith two lines:Then set
svn:ingoreproperty recursively:After that edit
svn:ignoreproperty in the project root:and add exclusion for the
*.outpattern.Given that:
The only way is to add such patterns to the global-ignores.
Some notes:
svn:ignoreproperty may be deleted recursively withthe help of the
svn propdel -R ...project-wide
svn:ignoreproperty.Hope this helps.