Are you sure?
I read in the pre-commit.tmpl comments that Subversion does not pass the
environment variables to the hook script. So we can't expect $PATH to be set for
us to call binaries without using the full path.
<repos>/hook-scripts/pre-commit.tmpl
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
If this is so, then Subversion will not re-pass the variables from Apache as
well. In apache, mod_dav_svn is used, which then calls the hook-scripts.
When I run a test in a pre-commit hook script, the environment is empty except
for this:
-
PWD=/
SHLVL=1
-
-RG
Phillip Susi wrote:
> I believe that apache exports all of its variables to the environment of
> child processes, so the server side commit script should be able to just
> look to the correct environment variable to see the host name, and add
> it to a revprop.
>
> Russell E Glaue wrote:
>> I like this idea.
>>
>> As a work around, how about this.
>>
>> 7c826d2-565b-344b-abac-b3242553bd93
>> I see this string in the apache logs (see log excerpt below).
>> Is this the transaction ID?
>> If so, then during the pre-commit we can match the transaction ID in
>> the apache log and pull out the client hostname/ipnumber.
>>
>> Assuming we're using Apache with dav_svn, apache receives HTTP request
>> like these:
>> -
>> 10.0.0.1 - jsmith [06/May/2007:04:24:03 -0500] "MKACTIVITY
>> /svn/MyRepos/!svn/act/97c826d2-565b-344b-abac-b3242553bd93 HTTP/1.1"
>> 201 326 "-" "SVN/1.3.1 (r19032) neon/0.25.5"
>>
>> 10.0.0.1 - jsmith [06/May/2007:04:24:24 -0500] "PUT
>> /svn/MyRepos/!svn/wrk/97c826d2-565b-344b-abac-b3242553bd93/trunk/file1.txt
>> HTTP/1.1" 204 - "-" "SVN/1.3.1 (r19032) neon/0.25.5"
>>
>> 10.0.0.1 - jsmith [06/May/2007:04:24:39 -0500] "DELETE
>> /svn/MyRepos/!svn/act/97c826d2-565b-344b-abac-b3242553bd93 HTTP/1.1"
>> 204 - "-" "SVN/1.3.1 (r19032) neon/0.25.5"
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 9 22:24:18 2007