Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN post commit: Who is the user that committed?

In an SVN post commit hook, how can I get the user who executed the commit?

like image 774
Blagomir Avatar asked Nov 18 '10 09:11

Blagomir


2 Answers

Using the svnlook command with author. For example, in a shell script, it might be:

REPOS="$1"
REV="$2"

AUTHOR="$(svnlook author -r $REV $REPOS)"
like image 131
Avi Avatar answered Oct 11 '22 18:10

Avi


post-commit hook script example:

#!/bin/sh
REPOS="$1"
REV="$2"
AUTHOR="$(svnlook author $REPOS -r $REV)"

# output on STDERR will be marshalled back to SVN client
echo "This transaction was commited by '$AUTHOR'!" 1>&2

exit 0
like image 35
splash Avatar answered Oct 11 '22 18:10

splash