[SvnBook] #110: ch09: Fix notation about post-* hook exit code and stderr treatment

SvnBook noreply at red-bean.com
Mon Apr 28 09:54:09 CDT 2008


#110: ch09: Fix notation about post-* hook exit code and stderr treatment
----------------------+-----------------------------------------------------
 Reporter:  cmpilato  |       Owner:  fitz         
     Type:  defect    |      Status:  new          
 Priority:  normal    |   Milestone:  1.5          
Component:  content   |     Version:  nightly/trunk
 Keywords:            |  
----------------------+-----------------------------------------------------
 Mark E. Hamilton <mhamilt {at} sandia.gov> sez:

 The description for the four post hooks (post-commit, post-revprop-change,
 post-lock, and post-unlock) all say this:

 The output from, and exit value returned by the post-commit hook program
 are ignored.

 However, this is not exactly correct, since if the exit value is set to
 non-zero the stderr output will be marshalled back to the user (similarly
 to the pre-* version of the hook.) If this is the desired behavior (and I
 like it, since it helps diagnose hook-script failures,) IMO the
 documentation should say something like this:

 If the post-commit hook program returns a non-zero exit status the commit
 *will not* be aborted, since it has already completed. However, anything
 printed to stderr will be marshalled back to the client, allowing for
 diagnosis of hook failures.

 I've attached a patch that makes this change (with the appropriate textual
 differences for each hook.)

 {{{
 Index: ch09-reference.xml
 ===================================================================
 --- ch09-reference.xml  (revision 3028)
 +++ ch09-reference.xml  (working copy)
 @@ -8241,8 +8241,11 @@
            that a commit has happened.  Some configurations also use
            this hook to trigger backup processes.</para>

 -        <para>The output from, and exit value returned by the
 -          post-commit hook program are ignored.</para>
 +        <para>If the post-commit hook program returns a non-zero exit
 +          status the commit <emphasis>will not</emphasis> be aborted,
 since it has already
 +          completed. However, anything printed to stderr will be
 +          marshalled back to the client, allowing for diagnosis of
 +          hook failures.</para>

        </refsect1>

 @@ -8367,6 +8370,12 @@
            typically used to send email notification of the property
            change.</para>

 +        <para>If the post-revprop-change hook program returns a non-zero
 exit
 +          status the change <emphasis>will not</emphasis> be aborted,
 since it has already
 +          completed. However, anything printed to stderr will be
 +          marshalled back to the client, allowing for diagnosis of
 +          hook failures.</para>
 +
          <para>The output from, and exit value returned by, the
            post-revprop-change hook program are ignored.</para>

 @@ -8488,8 +8497,11 @@
            locked.  It is typically used to send email notification of
            the lock event.</para>

 -        <para>The output from and exit value returned by the post-lock
 -          hook program are ignored.</para>
 +        <para>If the post-lock hook program returns a non-zero exit
 +          status the lock <emphasis>will not</emphasis> be aborted, since
 it has already
 +          completed. However, anything printed to stderr will be
 +          marshalled back to the client, allowing for diagnosis of
 +          hook failures.</para>

        </refsect1>

 @@ -8601,6 +8613,12 @@
            been unlocked.  It is typically used to send email
            notification of the unlock event.</para>

 +        <para>If the post-unlock hook program returns a non-zero exit
 +          status the unlock <emphasis>will not</emphasis> be aborted,
 since it has already
 +          completed. However, anything printed to stderr will be
 +          marshalled back to the client, allowing for diagnosis of
 +          hook failures.</para>
 +
          <para>The output from and exit value returned by, the
            post-unlock hook program are ignored.</para>

 }}}

-- 
Ticket URL: <http://svnbook.red-bean.com/trac/ticket/110>
SvnBook <http://svnbook.red-bean.com/>


More information about the svnbook-dev mailing list