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.
In Windows it is located in
%APPDATA%\Subversion\auth\
To find this directory, just go to run
(win-key+r), paste the above command and hit enter or click on Run
button.
For me, there was a file in folder svn.simple
. It is a text file and it has info with saved authentication data. I have something like this:
...
K 8
username
V 6
kosta
END
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
<http://your.1st.url.name.here:80> Authorization Realm
K 8
username
V 5
yourUserName
--
svn:realmstring
V 45
<http://your.2nd.url.name.here:80> Authorization Realm
K 8
username
V 5
yourUserName