You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Murli Varadachari <mv...@facebook.com> on 2009/04/24 22:35:47 UTC

pre-commit hooks to detect subversion access protocol

Is it possible for pre-commit hooks to detect the access protocol  used by engineer [ svn, http or svn+ssh ] to execute the commit operation?

Is there a way to get this info on the server side.

Cheers
Murli

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

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

Re: pre-commit hooks to detect subversion access protocol

Posted by Blair Zajac <bl...@orcaware.com>.
Andy Levy wrote:
> On Fri, Apr 24, 2009 at 18:54, Robert Mohr <li...@mohrr.net> wrote:
>> Sorry, should have replied to the list.
>>
>> SSH sets a couple of environment variables:  SSH_CLIENT and
>> SSH_CONNECTION (and, in an interactive mode, SSH_TTY).  You could
>> check for the presence of those.
>>
>> I've never checked, but I bet Apache sets an environment variable or
>> two.  If not, you should look at mod_env.
>>
>> I don't know how you could detect the svn protocol except for it not
>> being one of the above.
> 
> Subversion hooks execute with a nearly-empty environment. There's only
> maybe 2 or 3 environment variables set.

That's right.  The environment is deliberately cleared in all of the hook scripts.

Regards,
Blair

-- 
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<bl...@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/

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

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

Re: pre-commit hooks to detect subversion access protocol

Posted by Andy Levy <an...@gmail.com>.
On Fri, Apr 24, 2009 at 18:54, Robert Mohr <li...@mohrr.net> wrote:
> Sorry, should have replied to the list.
>
> SSH sets a couple of environment variables:  SSH_CLIENT and
> SSH_CONNECTION (and, in an interactive mode, SSH_TTY).  You could
> check for the presence of those.
>
> I've never checked, but I bet Apache sets an environment variable or
> two.  If not, you should look at mod_env.
>
> I don't know how you could detect the svn protocol except for it not
> being one of the above.

Subversion hooks execute with a nearly-empty environment. There's only
maybe 2 or 3 environment variables set.

> On Fri, Apr 24, 2009 at 6:35 PM, Murli Varadachari
> <mv...@facebook.com> wrote:
>>
>> Is it possible for pre-commit hooks to detect the access protocol  used by
>> engineer [ svn, http or svn+ssh ] to execute the commit operation?
>>
>> Is there a way to get this info on the server side.
>>
>> Cheers
>> Murli
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1898878
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>

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

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


Re: pre-commit hooks to detect subversion access protocol

Posted by Robert Mohr <li...@mohrr.net>.
Sorry, should have replied to the list.

SSH sets a couple of environment variables:  SSH_CLIENT and
SSH_CONNECTION (and, in an interactive mode, SSH_TTY).  You could
check for the presence of those.

I've never checked, but I bet Apache sets an environment variable or
two.  If not, you should look at mod_env.

I don't know how you could detect the svn protocol except for it not
being one of the above.

On Fri, Apr 24, 2009 at 6:35 PM, Murli Varadachari
<mv...@facebook.com> wrote:
>
> Is it possible for pre-commit hooks to detect the access protocol  used by
> engineer [ svn, http or svn+ssh ] to execute the commit operation?
>
> Is there a way to get this info on the server side.
>
> Cheers
> Murli

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

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