Easy to use SVN ignore

Published at 23, January 2009, author art. Tags: svn, tips, tools

I'm hate routine task. That's why I wrote a simple function to change svn:ignore propery on the current directory.

Add these lines in you .bashrc

function ignore()
{
    SVNIGNORE=/tmp/.svnignore
    svn propget svn:ignore . > "$SVNIGNORE"
    while [ -n "$1" ]; do
        echo "$1" >> "$SVNIGNORE"
        shift
    done
    svn propset svn:ignore --file "$SVNIGNORE" .
    rm "$SVNIGNORE"
}

Here is an example, how to use this script. Let's suppose, that you are in your working directory, and want to hide from SVN a 'packages' subdirectory and all files with .o suffix. Then you should run:

ignore packages '*.o'

Please, pay attention to the single quotes around '*.o', if you omit them, than shell will expand this pattern and only those files which exists on the disk will be added to the svn:ignore propery.

Comments

Subscribe on this post's comments

No comments. Wanna be first?

First, identify yourself and come back to leave comments.

If you wish to leave comment, please, identify yourself and then come back to this page.