Setting svn:ignore for Drupal's settings.php

The Problem
It's important to keep track of changes to your software. I use Subversion for version control. One issue that's always been quirky for me is ignoring files. The authority on Subversion, the red-bean book, doesn't give a lot of depth on svn:ignore. It describes how to do what you may have done before in CVS and how to match groups of files. That's useful but I work on Drupal and I have the same set of files on multiple servers for development. These servers have the same files but different quirks with .htaccess and settings.php. So when I check in changes I don't want my settings.php from a development server overwriting the changes.

The Solution
There's an easy way to fix this problem. I just want to set the svn:ignore property to tell subversion not to take settings.php. I skimmed a reference from someone using svn:ignore with ruby and adapted to my needs.

rob4@copper:~/htdocs/example/sites/default> svn propset svn:ignore 'settings.php' .
property 'svn:ignore' set on '.'
rob4@copper:~/htdocs/example/sites/default> svn status
 M     .
rob4@copper:~/htdocs/example/sites/default> svn ci

After that, no further changes to my settings.php got checked in. It's also possible to just leave settings.php unversioned but I want my repository to reflect the production version of the site. That means I'm going to have to clear the svn:ignore property before checking in changes that I want to show up in the production copy of the site. That should be pretty rare so I'm happy with the method I have right now.

update: Nope. Apparently, like so many things with version control, you need a lot of testing to figure these things out. Or you can read the book. Jeff pointed out the sidebar that says:

Subversion's support for ignorable file patterns extends only to the one-time process of adding unversioned files and directories to version control. Once an object is under Subversion's control, the ignore pattern mechanisms no longer apply to it. In other words, don't expect Subversion to avoid committing changes you've made to a versioned file simply because that file's name matches an ignore pattern—Subversion always notices all of its versioned objects.

So what I wanted to do - one copy in version control that's not updated on checkin - just isn't doable. In order to have Subversion ignore settings.php I'd need to do what I described in this post but also delete the file from the repository.
(In my defense, Google pointed me to an old version of the redbean book for svn:ignore which has a lot less information about it.)

Your rating: None Average: 3 (50 votes)

And now by linking again to the old version of the book, you are increasing its Google page-rank ;) At least you're associating the world 'old' with it...

Yeah, I know what you mean but I feel that Google's decisions about what links mean isn't my responsibility.