In an SVN post commit hook, how can I get the user who executed the commit?
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)"
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With