Wednesday, November 19, 2008

svn and tons of ignores

I never realized what a pain it was to maintain svn:ignore properties until I started using git (which makes it really easy to collect cruft metadata after a build).

After some searching on the web, I found this script:
#!/bin/bash

# svn-ignore - tell Subversion to ignore a file in certain operations.

# See: http://svn-ignore.notlong.com [svnbook.red-bean.com]

test -z "$1" && echo "Usage: $0 FILENAME" && exit -1

for fullname in "$@"

do

dirname=$(dirname "$fullname")

filename=$(basename "$fullname")

(svn propget svn:ignore "$dirname" | egrep -v '^$';

echo "$filename") >/tmp/svn-ignore.$$

svn propset svn:ignore -F /tmp/svn-ignore.$$ "$dirname"

rm /tmp/svn-ignore.$$

done


That coupled with:


for i in `svn status` ; do if [ $i != "?" ]; then echo $i ; svn-ignore $i ; fi ; done



really saved me a lot of work.

4 comments:

Anonymous said...

I'm looking for a Wade Berrier. And I was wondering if you have been to Norway in 1999, Mosjøen and Evje?

Wade Berrier said...

Yup, that's me!

Anonymous said...

Then I believe I was your Norwegian companion for a while... Do you still use your very old email address at usa.net ?

Wade Berrier said...

Sondre?

Sorry, my usa.net address went out of commission shortly after I returned to the States :(

My new address is now showing on my blogspot profile page:

http://www.blogger.com/profile/07040484967716682268