Posts tagged ‘ignore’

properties for ignoring files. Come on guys (gals?), this is crazy. Imagine you wanted an easy to use source code control system. You’d have something like:

svn ignore [files|dirs]+

But no, ignore files are handled through properties.
So fine, you need to do:

svn propset svn:ignore [files|dirs]* [target]

you can feel the pain, but even worse, when you run two in a row, it just takes the last (which makes sense because it’s “propset”, but please.

Like the dumbarse who put ?a=b&c=d in the W3 standard for links (& not &), not having standard control for ignore is just crazy.

Here is my “fix”. File “svnignore”:

#Usage svnignore [file|dir|pattern]+

if [ $# -eq 0 ]; then
        svn propget svn:ignore .
        exit 0;
svn propget svn:ignore . > $FILE
while [ $i -lt $# ]; do
        echo "$1" >> $FILE
sort -u $FILE | grep -v "^$" > $FILE.2
svn propset svn:ignore -F $FILE.2 .
svn propget svn:ignore .
/bin/rm -f $FILE $FILE.2

exit 0;

Example usage:

#ignore all files ending in .cgi (note the "s)
svnignore "*.cgi"

# just ignore the file mylog.out
svnignore mylog.out

#ignore the files file1.txt, blah.out and the subdirectory "mydir"
svnignore file1.txt blah.out mydir

ahh .. now I can easily ignore all the stuff I don’t want. Perhaps an alias for “svn propedit svn:ignore .” would also be handy…

Did I mention a nice interface for tags would also be good?