How to get current user that is using svn on particular workstation?
can I use svn.exe executable with some switch to get that info.
Thanks.
Edit: Note this answer only applies to SVN versions before 1.9. If you using SVN version >1.9, then try the svn auth
approach described in @bahrep's answer
This is a bash script that I use, which I put in my ~/bin/ folder and called svn_whoami.sh:
#!/bin/bash
debug=false
for ((i=1;i<=$#;i++)) do
case ${!i} in
-h|--help)
programName=$( basename ${0} )
echo "Usage:"
echo " ${programName} [-h|--help] [-d|--debug]"
echo
echo "Example:"
echo " ${programName} --debug"
exit 0;
;;
-d|--debug)
debug=true;
;;
esac;
done;
if [ "${debug}" == "true" ]; then
echo "cat ~/.subversion/auth/svn.simple/* | grep -A6 username --color";
fi;
cat ~/.subversion/auth/svn.simple/* | grep -A6 svn:realmstring
Output:
$ svn_whoami.sh -d
cat ~/.subversion/auth/svn.simple/* | grep -A6 username --color
svn:realmstring
V 53
Authorization Realm
K 8
username
V 5
yourUserName
--
svn:realmstring
V 45
Authorization Realm
K 8
username
V 5
yourUserName