You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Shane Huesdon <Sh...@bcaa.com> on 2007/12/27 22:24:56 UTC

Subversion, Linux, and pre-commit hook script - no workie

Hey all, new to the list but been on subversion since day 1 of 1.4.0
 
I have been googling all day on this one.
 
Basically my problem is that hook scripts do not appear to work at all
in my repository, even the basic .tmpl scripts.
 
I have tried hello world scripts for python and .sh but everything fails
as follows...
 

Re: Subversion, Linux, and pre-commit hook script - no workie

Posted by Hilco Wijbenga <hi...@gmail.com>.
On Dec 27, 2007 3:22 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
> Any output I got I posted, I did try one where I set 0 on the way out to
> ensure a positive test but still bombed. The problem doesn't seem
> related to the contents of the script but rather the process of calling
> it as the repo.

In my experience, putting echo statements is useless: the output
disappears. Unless you echo to stderr or a file.

If you tried simple pre-commits like "exit -1" and "exit 0" and it
didn't make any difference then I doubt you're scripts are running.
Are you sure they're in the right spot? Are you using the right
repository (assuming you have multiple)?

(I would definitely recommend creating a test repository on your
production server so you can really test things out. Every now and
then I make a copy of our production repository just so I have a
sandbox. Other people will probably appreciate that as well.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: Subversion, Linux, and pre-commit hook script - no workie

Posted by Shane Huesdon <Sh...@bcaa.com>.
Any output I got I posted, I did try one where I set 0 on the way out to
ensure a positive test but still bombed. The problem doesn't seem
related to the contents of the script but rather the process of calling
it as the repo.

 

 
---------------------------------------------
Shane Huesdon
BCAA Information Services
4567 Canada Way, Burnaby, BC V5G 4T1
Phone: 604.268.5425
Cell: 604.329.0936
Email: Shane.Huesdon@bcaa.com
 
 
 
 

-----Original Message-----
From: Mark [mailto:grimm26@gmail.com] 
Sent: Thursday, December 27, 2007 3:18 PM
To: Shane Huesdon
Cc: users@subversion.tigris.org
Subject: Re: Subversion, Linux, and pre-commit hook script - no workie

Did you check the exit value?

On Dec 27, 2007 4:53 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
>
> Ah sorry I didn't articulate that well, my tests are all run without 
> the file extension. I wrote and tested on a test installation of
subversion.
> Unfortunately the test box is windows. Everything works perfectly
there.
> That file list if from production, I can't leave the pre-commit script

> in effect there, I just bang off a quick test and then re-apply the 
> file extension in an effort to not block actual dev commits with my 
> busted hook scripts.
>
>
>
>
> ---------------------------------------------
> Shane Huesdon
> BCAA Information Services
> 4567 Canada Way, Burnaby, BC V5G 4T1
> Phone: 604.268.5425
> Cell: 604.329.0936
> Email: Shane.Huesdon@bcaa.com
>
>
>
>
>
>
> -----Original Message-----
> From: Mark [mailto:grimm26@gmail.com]
> Sent: Thursday, December 27, 2007 2:44 PM
> To: Shane Huesdon
> Cc: users@subversion.tigris.org
> Subject: Re: Subversion, Linux, and pre-commit hook script - no workie
>
> Neither pre-commit.py nor pre-commit.tmpl will run.  It needs to be 
> exactly named pre-commit.  pre-commit, in particular, need to exit 
> with 0 in order for the commit to be allowed.  Anything else is 
> considered an error and the commit is abandoned.
>
> On Dec 27, 2007 4:24 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
> >
> >
> > Hey all, new to the list but been on subversion since day 1 of 1.4.0
> >
> > I have been googling all day on this one.
> >
> > Basically my problem is that hook scripts do not appear to work at 
> > all
>
> > in my repository, even the basic .tmpl scripts.
> >
> > I have tried hello world scripts for python and .sh but everything 
> > fails as follows...
> >
> > From the apache log...
> > [Thu Dec 27 13:26:09 2007] [error] [client 192.197.4.26] Could not 
> > MERGE resource
"/repos/!svn/act/a9c4a960-938c-b348-8397-ec7fb6d8eb0a"
> > into "/repos/branches/4.1.0/Batch/Shared".  [409, #0] [Thu Dec 27
> > 13:26:09 2007] [error] [client 192.197.4.26] An error occurred while

> > committing the transaction.  [409, #165001] [Thu Dec 27 13:26:09 
> > 2007]
>
> > [error] [client 192.197.4.26] 'pre-commit' hook failed with error 
> > output:\n  [409, #165001]
> >
> > Hook script file details...
> > -rwxr-xr-x    1 svn      svn           223 Dec 27 11:36
pre-commit.py
> > -rwxr-xr-x    1 svn      svn          2940 Oct 26  2006
> pre-commit.tmpl
> >
> > I have read many people talking about the lack of ENV and how you 
> > need
>
> > to create the environment inline to the script as subversion 
> > launches the hook scripts with no ENV for security. Would that only 
> > be relevent
>
> > if you were calling something that needs a path or whatnot, a simple

> > hello work print statement should be fine with no environment, no?
> >
> > Example script that failed....
> > #!/bin/sh
> > # This is a comment!
> > /bin/echo Hello World # This is a comment, too!
> >
> > It runs when I run it as the svn user on the command line.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------
> > Shane Huesdon
> > BCAA Information Services
> > 4567 Canada Way, Burnaby, BC V5G 4T1
> > Phone: 604.268.5425
> > Cell: 604.329.0936
> > Email: Shane.Huesdon@bcaa.com
> >
> >
> >
> >
> >   WARNING - CONFIDENTIALITY NOTICE This e-mail and any attachments 
> > may
>
> > contain confidential and privileged information. Any use, 
> > disclosure, copying or dissemination of this information by a person

> > other than an
>
> > intended recipient is not authorized and may be illegal. If you are 
> > not an intended recipient, please notify the sender immediately by 
> > return e-mail, delete this e-mail and destroy any copies. Thank you.
>
>
>
> --
> Mark
> "Blessed is he who finds happiness in his own foolishness, for he will

> always be happy."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>



--
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Subversion, Linux, and pre-commit hook script - no workie

Posted by Mark <gr...@gmail.com>.
Did you check the exit value?

On Dec 27, 2007 4:53 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
>
> Ah sorry I didn't articulate that well, my tests are all run without the
> file extension. I wrote and tested on a test installation of subversion.
> Unfortunately the test box is windows. Everything works perfectly there.
> That file list if from production, I can't leave the pre-commit script
> in effect there, I just bang off a quick test and then re-apply the file
> extension in an effort to not block actual dev commits with my busted
> hook scripts.
>
>
>
>
> ---------------------------------------------
> Shane Huesdon
> BCAA Information Services
> 4567 Canada Way, Burnaby, BC V5G 4T1
> Phone: 604.268.5425
> Cell: 604.329.0936
> Email: Shane.Huesdon@bcaa.com
>
>
>
>
>
>
> -----Original Message-----
> From: Mark [mailto:grimm26@gmail.com]
> Sent: Thursday, December 27, 2007 2:44 PM
> To: Shane Huesdon
> Cc: users@subversion.tigris.org
> Subject: Re: Subversion, Linux, and pre-commit hook script - no workie
>
> Neither pre-commit.py nor pre-commit.tmpl will run.  It needs to be
> exactly named pre-commit.  pre-commit, in particular, need to exit with
> 0 in order for the commit to be allowed.  Anything else is considered an
> error and the commit is abandoned.
>
> On Dec 27, 2007 4:24 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
> >
> >
> > Hey all, new to the list but been on subversion since day 1 of 1.4.0
> >
> > I have been googling all day on this one.
> >
> > Basically my problem is that hook scripts do not appear to work at all
>
> > in my repository, even the basic .tmpl scripts.
> >
> > I have tried hello world scripts for python and .sh but everything
> > fails as follows...
> >
> > From the apache log...
> > [Thu Dec 27 13:26:09 2007] [error] [client 192.197.4.26] Could not
> > MERGE resource "/repos/!svn/act/a9c4a960-938c-b348-8397-ec7fb6d8eb0a"
> > into "/repos/branches/4.1.0/Batch/Shared".  [409, #0] [Thu Dec 27
> > 13:26:09 2007] [error] [client 192.197.4.26] An error occurred while
> > committing the transaction.  [409, #165001] [Thu Dec 27 13:26:09 2007]
>
> > [error] [client 192.197.4.26] 'pre-commit' hook failed with error
> > output:\n  [409, #165001]
> >
> > Hook script file details...
> > -rwxr-xr-x    1 svn      svn           223 Dec 27 11:36 pre-commit.py
> > -rwxr-xr-x    1 svn      svn          2940 Oct 26  2006
> pre-commit.tmpl
> >
> > I have read many people talking about the lack of ENV and how you need
>
> > to create the environment inline to the script as subversion launches
> > the hook scripts with no ENV for security. Would that only be relevent
>
> > if you were calling something that needs a path or whatnot, a simple
> > hello work print statement should be fine with no environment, no?
> >
> > Example script that failed....
> > #!/bin/sh
> > # This is a comment!
> > /bin/echo Hello World # This is a comment, too!
> >
> > It runs when I run it as the svn user on the command line.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------
> > Shane Huesdon
> > BCAA Information Services
> > 4567 Canada Way, Burnaby, BC V5G 4T1
> > Phone: 604.268.5425
> > Cell: 604.329.0936
> > Email: Shane.Huesdon@bcaa.com
> >
> >
> >
> >
> >   WARNING - CONFIDENTIALITY NOTICE This e-mail and any attachments may
>
> > contain confidential and privileged information. Any use, disclosure,
> > copying or dissemination of this information by a person other than an
>
> > intended recipient is not authorized and may be illegal. If you are
> > not an intended recipient, please notify the sender immediately by
> > return e-mail, delete this e-mail and destroy any copies. Thank you.
>
>
>
> --
> Mark
> "Blessed is he who finds happiness in his own foolishness, for he will
> always be happy."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>



-- 
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: Subversion, Linux, and pre-commit hook script - no workie

Posted by Shane Huesdon <Sh...@bcaa.com>.
 
Ah sorry I didn't articulate that well, my tests are all run without the
file extension. I wrote and tested on a test installation of subversion.
Unfortunately the test box is windows. Everything works perfectly there.
That file list if from production, I can't leave the pre-commit script
in effect there, I just bang off a quick test and then re-apply the file
extension in an effort to not block actual dev commits with my busted
hook scripts. 

 

 
---------------------------------------------
Shane Huesdon
BCAA Information Services
4567 Canada Way, Burnaby, BC V5G 4T1
Phone: 604.268.5425
Cell: 604.329.0936
Email: Shane.Huesdon@bcaa.com
 
 
 
 

-----Original Message-----
From: Mark [mailto:grimm26@gmail.com] 
Sent: Thursday, December 27, 2007 2:44 PM
To: Shane Huesdon
Cc: users@subversion.tigris.org
Subject: Re: Subversion, Linux, and pre-commit hook script - no workie

Neither pre-commit.py nor pre-commit.tmpl will run.  It needs to be
exactly named pre-commit.  pre-commit, in particular, need to exit with
0 in order for the commit to be allowed.  Anything else is considered an
error and the commit is abandoned.

On Dec 27, 2007 4:24 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
>
>
> Hey all, new to the list but been on subversion since day 1 of 1.4.0
>
> I have been googling all day on this one.
>
> Basically my problem is that hook scripts do not appear to work at all

> in my repository, even the basic .tmpl scripts.
>
> I have tried hello world scripts for python and .sh but everything 
> fails as follows...
>
> From the apache log...
> [Thu Dec 27 13:26:09 2007] [error] [client 192.197.4.26] Could not 
> MERGE resource "/repos/!svn/act/a9c4a960-938c-b348-8397-ec7fb6d8eb0a" 
> into "/repos/branches/4.1.0/Batch/Shared".  [409, #0] [Thu Dec 27 
> 13:26:09 2007] [error] [client 192.197.4.26] An error occurred while 
> committing the transaction.  [409, #165001] [Thu Dec 27 13:26:09 2007]

> [error] [client 192.197.4.26] 'pre-commit' hook failed with error 
> output:\n  [409, #165001]
>
> Hook script file details...
> -rwxr-xr-x    1 svn      svn           223 Dec 27 11:36 pre-commit.py
> -rwxr-xr-x    1 svn      svn          2940 Oct 26  2006
pre-commit.tmpl
>
> I have read many people talking about the lack of ENV and how you need

> to create the environment inline to the script as subversion launches 
> the hook scripts with no ENV for security. Would that only be relevent

> if you were calling something that needs a path or whatnot, a simple 
> hello work print statement should be fine with no environment, no?
>
> Example script that failed....
> #!/bin/sh
> # This is a comment!
> /bin/echo Hello World # This is a comment, too!
>
> It runs when I run it as the svn user on the command line.
>
>
>
>
>
>
>
>
>
> ---------------------------------------------
> Shane Huesdon
> BCAA Information Services
> 4567 Canada Way, Burnaby, BC V5G 4T1
> Phone: 604.268.5425
> Cell: 604.329.0936
> Email: Shane.Huesdon@bcaa.com
>
>
>
>
>   WARNING - CONFIDENTIALITY NOTICE This e-mail and any attachments may

> contain confidential and privileged information. Any use, disclosure, 
> copying or dissemination of this information by a person other than an

> intended recipient is not authorized and may be illegal. If you are 
> not an intended recipient, please notify the sender immediately by 
> return e-mail, delete this e-mail and destroy any copies. Thank you.



--
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Subversion, Linux, and pre-commit hook script - no workie

Posted by Mark <gr...@gmail.com>.
Neither pre-commit.py nor pre-commit.tmpl will run.  It needs to be
exactly named pre-commit.  pre-commit, in particular, need to exit
with 0 in order for the commit to be allowed.  Anything else is
considered an error and the commit is abandoned.

On Dec 27, 2007 4:24 PM, Shane Huesdon <Sh...@bcaa.com> wrote:
>
>
> Hey all, new to the list but been on subversion since day 1 of 1.4.0
>
> I have been googling all day on this one.
>
> Basically my problem is that hook scripts do not appear to work at all in my
> repository, even the basic .tmpl scripts.
>
> I have tried hello world scripts for python and .sh but everything fails as
> follows...
>
> From the apache log...
> [Thu Dec 27 13:26:09 2007] [error] [client 192.197.4.26] Could not MERGE
> resource "/repos/!svn/act/a9c4a960-938c-b348-8397-ec7fb6d8eb0a" into
> "/repos/branches/4.1.0/Batch/Shared".  [409, #0]
> [Thu Dec 27 13:26:09 2007] [error] [client 192.197.4.26] An error occurred
> while committing the transaction.  [409, #165001]
> [Thu Dec 27 13:26:09 2007] [error] [client 192.197.4.26] 'pre-commit' hook
> failed with error output:\n  [409, #165001]
>
> Hook script file details...
> -rwxr-xr-x    1 svn      svn           223 Dec 27 11:36 pre-commit.py
> -rwxr-xr-x    1 svn      svn          2940 Oct 26  2006 pre-commit.tmpl
>
> I have read many people talking about the lack of ENV and how you need to
> create the environment inline to the script as subversion launches the hook
> scripts with no ENV for security. Would that only be relevent if you were
> calling something that needs a path or whatnot, a simple hello work print
> statement should be fine with no environment, no?
>
> Example script that failed....
> #!/bin/sh
> # This is a comment!
> /bin/echo Hello World # This is a comment, too!
>
> It runs when I run it as the svn user on the command line.
>
>
>
>
>
>
>
>
>
> ---------------------------------------------
> Shane Huesdon
> BCAA Information Services
> 4567 Canada Way, Burnaby, BC V5G 4T1
> Phone: 604.268.5425
> Cell: 604.329.0936
> Email: Shane.Huesdon@bcaa.com
>
>
>
>
>   WARNING - CONFIDENTIALITY NOTICE This e-mail and any attachments may
> contain confidential and privileged information. Any use, disclosure,
> copying or dissemination of this information by a person other than an
> intended recipient is not authorized and may be illegal. If you are not an
> intended recipient, please notify the sender immediately by return e-mail,
> delete this e-mail and destroy any copies. Thank you.



-- 
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org