[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Hook scripts start with an empty environment

From: Alan Barrett <apb_at_cequrux.com>
Date: Sat, 10 Apr 2010 12:10:53 +0200

On Wed, 24 Mar 2010, Tim Starling wrote:
> Hook scripts start with an empty environment instead of inheriting it
> from svnserve or whatever.
>
> This is inconvenient, not least for the case where you want to commit
> something to an svn+ssh server via a local pushmi mirror on file:/// and
> your SSH_AUTH_SOCK is lost so you have to type your passphrase all the time.

As a workaround for this particular issue, you could do the following
without modifying svn at all:

    * Run svn through a wrapper script that saves the value of
      SSH_AUTH_SOCK to a file whose name is derived from the pid
      (e.g. echo $SSH_AUTH_SOCK >/tmp/ssh-auth-sock.$$).

    * In the hook script, walk up the chain of parent processes (e.g.
      by parsing the output from "ps") until it finds the pid of the
      wrapper script; then read the file that the wrapper script saved.

On the other hand, I think it would be reasonable to have a configurable
way of allowing specified environment variables to be passed to hook
scripts.

--apb (Alan Barrett)
Received on 2010-04-10 12:11:35 CEST

This is an archived mail posted to the Subversion Dev mailing list.