You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by we...@tigris.org on 2009/03/20 10:59:22 UTC

PRE COMMIT HOOK USER NAME OF COMMIT

Hi all,
is there any way to find out the user name in Pre commit hook i.e which user had issued the commit command. i want to know the user name from which svn commit is fired in Pre-commit hook, so that i can pass/hault the commit operation.

Thanks in advance

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1363650

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: PRE COMMIT HOOK USER NAME OF COMMIT

Posted by David Weintraub <qa...@gmail.com>.
Use the svnlook command. There's a "svnlook author" which will tell
you the author of a particular change via a particular transaction
number (you get the transaction number when the hook is called) or the
revision number. Here's a shell script example below:

    author=`/usr/bin/svnlook author -t $TRANS_NO $SVN_REPOS`

On Fri, Mar 20, 2009 at 6:59 AM,  <we...@tigris.org> wrote:
> Hi all,
> is there any way to find out the user name in Pre commit hook i.e which user had issued the commit command. i want to know the user name from which svn commit is fired in Pre-commit hook, so that i can pass/hault the commit operation.
>
> Thanks in advance
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1363650
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>



-- 
--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1365893

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: PRE COMMIT HOOK USER NAME OF COMMIT

Posted by Giulio T <gi...@uk.linedata.com>.
>


Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851    VAT Reg No 778499447

-----Original Message-----


> From: webpost@tigris.org [mailto:webpost@tigris.org]
> Sent: 20 March 2009 10:59
> To: users@subversion.tigris.org
> Subject: PRE COMMIT HOOK USER NAME OF COMMIT
>
> Hi all,
> is there any way to find out the user name in Pre commit hook
> i.e which user had issued the commit command. i want to know
> the user name from which svn commit is fired in Pre-commit
> hook, so that i can pass/hault the commit operation.
>
> Thanks in advance

I believe the start-commit is what you're looking for. One of the parameters passed to the hook is the user name.

If I'm wrong (quite possible) then you can use the svnlook author command to get the user name. remember to use it with the -t option not -r.

Giulio

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1365657

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].