Random thing that I figured out, after having some unsuccessful google searches. Here's hoping this little tidbit will save someone some time some day.
For those using Subversion and Xcode, this may be particularly relevant. And that'll be my example, though I'm sure there are plenty of other times that this could come up, as well.
When creating a new project (let's call it "Foo") in Xcode, a bunch of stuff is created. for example, when I create a new iPhone application project called Foo, I get the following hierarchy of files:
Of these, there are a few things I don't want:
- The entire Foo/build/ hierarchy.
- the lindes.pbxuser and lindes.mode1v3 files under Foo/Foo.xcodeproj. (I'm actually not 100% sure there's no useful information in these files, but they sure do change a lot, and I think most of the important stuff is in project.pbxproj, so... here's hoping these are safe to ignore. If anyone knows more about that, please feel free to point me at an authoritative reference or give me the skinny in the comments.)
If I do just svn add Foo, though, I get those things. I want to ignore them.
Well, I can do svn propset svn:ignore build Foo after my add, but build has already been added, so it's still going to go into the repository if I don't do something about it. (And then I'd do the same thing (but most likely using svn propedit) for *.pbxuser and *.mode1v3 under the xcodeproj directory.)
So what I was looking for was an option for telling svn add to ignore certain things during the add process. As far as I was able to determine, there is no option to svn add that will do this. But there is a way to get basically what I want! It's called "svn revert". With appropriate options, it will make svn forget you ever added something, without otherwise modifying anything.
Here's an example set of commands that would do the trick:
: $; svn add Foo
: $; cd Foo
: $; svn revert -R build
: $; svn propset svn:ignore build .
: $; cd Foo.xcodeproj
: $; svn revert *.pbxuser *.mode1v3
: $; svn propset svn:ignore "*.pbxuser
: $; cd ..
: $; svn status
(Couple quick notes: (1) my shell prompt is ': $; ' (and the text actually typed is in bold), (2) in that second svn propset, I actually hit return inside the quotes. In my shell (zsh), I get a second-level prompt of 'dquote> ' when I do this, but I didn't want to confuse the text above with that.)
And that does the trick. If I now do an svn status, I get:
No "?" lines, no build or its contents, and no pbxuser or mode1v3 files. Perfect!
(Well, OK, it might be useful to do something with TemplateInfo.plist.orig, but... that's something to figure out another day. :-)