SVN post commit: Who is the user that committed?
Asked Answered
H

3

13

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

Hangover answered 18/11, 2010 at 9:46 Comment(0)
S
23

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)"
Sowers answered 18/11, 2010 at 9:52 Comment(0)
S
6

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
Stickinthemud answered 18/11, 2010 at 9:51 Comment(0)
D
0

The second parameter to your post-commit script will be the revision number - you can use this to query SVN for whatever information you need.

Diorio answered 18/11, 2010 at 9:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.