0

I commit all my changes in use of svn (from command line). The problem I have, is that I always forget about code chill, before milestone for example, and I still commit. I just can't think about these deadline for some reason. Can anyone tell me how can I implement a script that will print me a question on command line after I type "svn commit"?

Lukasz
  • 691
  • 1
  • 12
  • 30
  • Your release manager should be controlling this from the server end. It should not be up to the individual developer(s) to protect the repository. – alroc Sep 02 '13 at 17:34

2 Answers2

2

You could use svn pre-commit hook.

each time you svn commit the pre-commit script will be executed.

svn hooks can be written in bash, perl, python, etc even C or C++, it just need to be executable.

More info on how to write svn hooks here

Community
  • 1
  • 1
Mali
  • 2,990
  • 18
  • 18
1

Add this to your ~/.bashrc:

function svn {    
    case $1 in
        ci)
           ;;
        commit)
           ;;
        *)
           return /usr/bin/svn $@
           ;;
    esac

    echo "Did you ... ?"
    read answer
    if [ "$answer" = "yes" ] ; then
        /usr/bin/svn $@
    fi
}
hek2mgl
  • 152,036
  • 28
  • 249
  • 266