Brett Porter

Working around –non-interactive problems in Leopard’s Subversion

February 25, 2008 · 4 Comments

Apparently, the –non-interactive flag is broken in Subversion as distributed with Leopard and a fix is not yet available. Bad news for Maven users wanting to use any of the SCM tools.

Hopefully a fix will be available either through an update or a version of Subversion that can be compiled from source, but in the mean time I put this shell script ahead of svn in my PATH:

Updated 15 Mar 08: Wendy pointed out you need to chop the username too. Now it’s even more hacky.

#!/bin/sh

if [ "$1" = "--non-interactive" -o "$1" = "--username" ]; then
  shift
fi

if [ "$1" = "--non-interactive" -o "$1" = "--username" ]; then
  shift
fi

/usr/bin/svn "$@"

Mmm, hacky.

Categories: Mac OS X · Maven
Tagged: , , , ,

4 responses so far ↓

  • Wendy Smoak // March 9, 2008 at 3:14 pm | Reply

    This doesn’t quite do it for the release process, which executes “svn –username wsmoak –non-interactive commit …”

  • Hern // October 22, 2008 at 6:59 am | Reply

    thanks man, you made my day

  • Luke Daley // May 16, 2009 at 7:51 pm | Reply

    This also applies to any svn built by macports.

  • Gorenje // June 16, 2009 at 7:13 pm | Reply

    I needed the same thing but it broke when doing something like svn commit -m “blah blah blah” fubar.c snafu.h

    Basically the spaces in the message were being kicked out.

    So I wrote something that checked for spaces in the arguments and kept them.

    #!/bin/bash                                                                                                                                                            
    
    declare -a params
    space=" "
    for n in "$@" ; do
      if [ "$n" == "--non-interactive" ]; then
        params=(${params[@]})
      else
        # check with argument contains spaces, if so wrap it in cotton wool
        if [ "${n/$space/_}" != "${n}" ]; then
          params=(${params[@]} "'$n'")
        else
          params=(${params[@]} $n)
        fi
      fi
    done
    eval /usr/bin/svn-orig ${params[@]}
    

Leave a Comment