Can I override svn:ignore for individual directories?
Asked Answered
I

2

8

The default global ignore for Subversion does a good job of keeping build artifacts out of version control. What if I need to distribute a directory of compiled code for my stuff to build?

I don't want to pick up my output (in, say, /target), and I want to continue ignoring all compiled code for most of my other projects, but just one directory (say, /input) needs to always track files with a .a extension.

Is there a property I can set on the /input directory that will make svn add pick up new .a files in there, without altering the global-ignores property?

Indigoid answered 18/10, 2011 at 15:13 Comment(0)
D
8

The svn:ignore setting is a per-directory property. It applies to a given directory, and adds to rather than overrides the global-ignores setting. See Ignoring Unversioned Items in the SVN book.

I would say you have two viable options:

  1. Don't include *.a in the global-ignores setting, but rather only set it in the svn:ignore property on directories where such files tend to appear, such as /target.
  2. Keep *.a in the global-ignores setting, and manually call svn add on each of the .a files you wish to track. Once they are tracked by SVN, the ignore setting will no longer apply to them.
Dethrone answered 18/10, 2011 at 15:14 Comment(7)
Right, but what's the syntax for saying don't ignore (this pattern)? I mean, if it's already ignored, how do I "un-ignore" it?Indigoid
remove it from the svn:ignore property. svn propedit svn:ignoreAllyce
svnbook.red-bean.com/en/1.1/ch07s02.html#id3022585 tells "The patterns are strictly for that directory—they do not carry recursively into subdirectories."Gory
Sorry, I didn't understand the situation properly at first. I amended my answer. I don't think the ideal solution exists, but you can get pretty comfortable with either of the above suggestions.Dethrone
I tried to make it clear in the original question... I knew about both of those options, and they both have enough drawbacks that I wanted to avoid them if at all possible. If these are the only options, I just wanted to see it said in black-and-white.Indigoid
It may be that there is a way of doing it that I am not aware of, but it doesn't seem that way from the docs. Sorry.Dethrone
Accepting this because the short version is "no, you can't do what you want", and this is what you're stuck with :-/Indigoid
F
0

Just encounter this issue and solved in SmartSVN Client (but the solution should be applicable to other SVN clients). You should be able to manually include an ignored file/directory without changing any svn:ignore settings.

The problem you might have is that the files may not be visible so you will have to show them first.

Solution:

  • Show ignored files
  • Right click the ignore file/directory and click "Add"
Fogdog answered 29/7, 2022 at 15:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.