svn ignores svn:ignore?

Well, it did. On one of my pet-projects called Sphoof, hosted over at Google Code, I had created directories for API documentation and log-output from the unit-tests, telling me if the unit tests were successful, the percentage of code coverage and violations of our coding standards. That’s great and all, but it doesn’t necessarily need to be in the repository. Nevertheless, I wanted those directories under the project’s main directory, to keep it all in the same place which makes it that much easier to find. Since they kept on popping up in svn stat, I decided to add the directories to the repository in a flash of humongous FAIL.

After committing all of the API docs and logs, which are bigger than the project itself, I figured I accidentally added them, but I actually wanted to ignore them instead. So, I emptied the directories and “svn propedit svn:ignore .” would have to do the trick. I added the directories I didn’t want to see and committed again. I didn’t work. Figuring it must’ve been my error, I tried again. And again. And again. Finally, I asked one of my co-developers to try it for me instead, see if this was actually a problem between my keyboard and chair. He ignored, committed, and found the repository filled with logs and docs. He tried again. And again. And again.

Finally, I figured out the problem: although subversion will happily tell you that the properties for ‘.’ have been changed, it only ignores files and directories that do not exist in the repository at the time you try ignore them. Yes, I did read the otherwise excellent documentation, but it doesn’t tell you that it can’t be done. It took me a few hours to find out. So: if you find subversion does not listen to the svn:ignore property: make sure that the files aren’t in the repository already. If they are, delete them from the repository, commit the change in which they are deleted and set the ignores as usual.

I do hope this might save someone some time.

Category: subversion 2 comments »

2 Responses to “svn ignores svn:ignore?”

  1. Taco

    This took WAY too much time… Just look at commits r119 up to r129… Glad you figured it out in the end, just before our mental meltdown.

  2. David Weinraub

    I actually tun into this one quite often: accidentally add stuff and then later realize that it would have been better to simply ignore it. Got bitten a whole bunch of times before I realized, like you did, that I had to delete first, then ignore.

    Relieved to hear that it’s not just me. ;-)

    In fact, one other related thing I run into: want folder X in the repo, but none of its contents. Always need to remember to add the folder, commit, ignore the contents, commit.

    I hope that makes sense. I’m kind of an SVN n00b.


Leave a Reply

Back to top