Question

Dans un crochet post svn commit, comment puis-je l'utilisateur qui a exécuté le commit?

Était-ce utile?

La solution

En utilisant la commande svnlook avec author . Par exemple, dans un script shell, il pourrait être:

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

AUTHOR="$(svnlook author -r $REV $REPOS)"

Autres conseils

Exemple de script crochet post-commit:

#!/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

Le second paramètre à votre script post-commit sera le numéro de révision - vous pouvez l'utiliser pour interroger SVN pour toutes les informations dont vous avez besoin

.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top