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

Re: Hooks

From: D.J. Heap <dj_at_shadyvale.net>
Date: 2003-08-21 15:38:12 CEST

Greg Hudson wrote:
> On Thu, 2003-08-21 at 01:12, dj wrote:
>
>>While trying to fix the hook's stderr messiness on Windows, it appears
>>to me that on RH9 Linux, at least, hook output is not being sent back to
>>the client on failures.
>
>
> Here's what I would expect:
>
> ra_local: You should see hook stdout and stderr.
> ra_svn with ssh: You should see hook stderr; hook stdout will
> corrupt the data stream and give you malformed network data
> errors.
> ra_svn without ssh: hook stdout and stderr go nowhere.
> ra_dav: hook stdout and stderr go nowhere.
>
> The network protocols simply don't have any mechanism for conveying
> output from hook scripts; when it does work, it works by accident.

Hmm, isn't that what this piece of hooks.c at about line 100 is trying
to do? Read captured stderr on failure and return it as an error
result? Since it's part of an error message it should go through error
message marshalling, I would think...but I'm new to this code, so I'm
not sure.

   if (!err && check_exitcode)
     {
       /* Command failed. */
       if (! APR_PROC_CHECK_EXIT (exitwhy) || exitcode != 0)
         {
           svn_stringbuf_t *error;

           /* Read the file's contents into a stringbuf, allocated in
POOL. */
           SVN_ERR (svn_stringbuf_from_aprfile (&error, read_errhandle,
pool));

           err = svn_error_createf
               (SVN_ERR_REPOS_HOOK_FAILURE, err,
                "'%s' hook failed with error output:\n%s",
                name, error->data);
         }
     }

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 21 15:39:12 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.