You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brian Krusic <br...@krusic.com> on 2007/08/01 21:19:42 UTC

hook script basics

Hi All,

I've implemented a few hook scripts in the past; checking case,  
forcing log messages and sending emails about the commits.

However it appears I just implemented this stuff w/o understanding it.

* problem *

I have a simple post-commit.bat file which contains commands I want  
to call.

In my case the contents of the post commit is;

@echo off
C:\Progra~1\Subversion\bin\svn update --username foo --password bar -- 
no-auth-cache F:\Jobs\Cooljob


The F:\Jobs\Cooljobs is the local dir that sits on the repo server  
itself as I checked out the repo on the same PC.

The username/pass is used for example only.

The file works if I exe it from a cli on the repo server but not when  
I commit from another PC.

I expect it to work like so;

1 - User commits a file from some workstation.
2 - Repo executes the post commit which updates a checked out copy on  
the server itself.

I'm doing some batch rendering hence why the checked out copy on the  
server.

Bri-

Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi John,

1 thing it could be is that I was lazy and didn't set up a CA.

So my certs are self signed and don't match the server.

Perhaps the "certs don't match..." error is preventing this as the  
script has no way of pressing accept.  I'm unsure who this script  
runs as anyways.

What do you think?

And is there a way of me configging SSL so that the error of non  
matching certs doesn't come up?

I do plan to do a CA later this year (Its on my mile stones schedule  
for this fall) however I would like to solve this now.

-Brian

On Aug 2, 2007, at 5:40 AM, John Peacock wrote:

> Brian Krusic wrote:
>> Why isn't svn update working while as a post hook?
>
> Probably because you are trying to update a network resource which the
> Subversion service has no permission to update?  Under Windows,  
> services are
> [typically] executed by special local accounts, which do not have  
> access to any
> networked (drive-mapped) resources.  The batch file works as an  
> ordinary user,
> because you have the appropriate drive map and rights to use the  
> remote
> resource.  The Subversion service cannot execute the same script  
> because it
> doesn't have the drive map and if you added the 'net map' to the  
> script, the
> service user would not have the rights in any case.
>
> What I do for our Windows servers is to install Cywin's sshd (SSH  
> daemon), and
> then use SVN::Notify::Mirror:
>
> 	http://search.cpan.org/search?query=SVN-Notify-Mirror
>
> which I wrote specifically to permit complex update rules in a post- 
> commit
> script (I use SVN::Notify::Config so that the script is the config  
> file).
>
> John
>
> -- 
> John Peacock
> Director of Information Research and Technology
> Rowman & Littlefield Publishing Group
> 4501 Forbes Blvd
> Suite H
> Lanham, MD 20706
> 301-459-3366 x.5010
> fax 301-429-5747
>


Re: hook script basics

Posted by John Peacock <jp...@rowman.com>.
Brian Krusic wrote:
> Why isn't svn update working while as a post hook?

Probably because you are trying to update a network resource which the
Subversion service has no permission to update?  Under Windows, services are
[typically] executed by special local accounts, which do not have access to any
networked (drive-mapped) resources.  The batch file works as an ordinary user,
because you have the appropriate drive map and rights to use the remote
resource.  The Subversion service cannot execute the same script because it
doesn't have the drive map and if you added the 'net map' to the script, the
service user would not have the rights in any case.

What I do for our Windows servers is to install Cywin's sshd (SSH daemon), and
then use SVN::Notify::Mirror:

	http://search.cpan.org/search?query=SVN-Notify-Mirror

which I wrote specifically to permit complex update rules in a post-commit
script (I use SVN::Notify::Config so that the script is the config file).

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Blvd
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

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

Re: hook script basics

Posted by Jeremy Pereira <je...@jeremyp.net>.
On 7 Aug 2007, at 14:16, Ryan Schmidt wrote:

>
> On Aug 6, 2007, at 20:49, Jeremy Pereira wrote:
>
>>
>> If it is a bug, it's an APR bug.  Subversion passes a null  
>> environment pointer to apr_proc_create and my cursory inspection  
>> of the Windows and Unix versions of this function is that the  
>> semantics are different.
>>
>> On Unix, if the environment pointer is null, a pointer to an empty  
>> array is passed to the exec call (i.e. an array initialised thus:  
>> { NULL }).  In the Windows version of the call, it appears that a  
>> null pointer is passed to CreateProcW.  Here's the Microsoft  
>> documentation for the environment parameter:
>>
>> "[in] A pointer to the environment block for the new process. If  
>> this parameter is NULL, the new process uses the environment of  
>> the calling process."
>>
>> http://msdn2.microsoft.com/en-us/library/ms682425.aspx
>
> Thanks for finding that. Is there equivalent information for UNIX- 
> like operating systems?

man 3 exec

>
> I'm not familiar with the way APR works or is supposed to work.  
> This page does not specify what the behavior is supposed to be when  
> the env is null:
>
> http://apr.apache.org/docs/apr/1.2/ 
> group__apr__thread__proc.html#gb51dd90b98d365a969f0ec5c7bef4e14
>
> Is there any other APR documentation?

Don't know.  I just got curious and rummaged around the Subversion  
and APR code for 10 minutes.

>
> I assume, though, that APR functions should generally behave the  
> same on all platforms, due to the word "portable" in the project's  
> name.

I would assume the same, but I don't think that is a correct  
assumption for apr_proc_create.  I must emphasise that I might be  
missing something, as I said I only spent a few minutes on it.

I think the sbuversion devs could work around the problem by passing  
a pointer to an empty null terminated array instead of a null pointer.

>
> I searched the Apache bugzilla for "apr_proc_create" and didn't  
> find anything that looked relevant.
>
> Is there someone already on the APR list who could ask them? Or  
> should we just submit a bug report?
>
>
>

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

Re: hook script basics

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 6, 2007, at 20:49, Jeremy Pereira wrote:

> On 6 Aug 2007, at 11:19, Ryan Schmidt wrote:
>
>> Yes, the env is empty on UNIX-like systems, but I've heard it  
>> reported here before that on Windows the env is not empty. I'd  
>> call that a bug; Subversion should empty the env on Windows  
>> systems too, to be consistent, and since the Book says the env is  
>> empty for security reasons.
>>
>> Can we agree that this is a bug? I couldn't find one filed in the  
>> issue tracker.
>
> If it is a bug, it's an APR bug.  Subversion passes a null  
> environment pointer to apr_proc_create and my cursory inspection of  
> the Windows and Unix versions of this function is that the  
> semantics are different.
>
> On Unix, if the environment pointer is null, a pointer to an empty  
> array is passed to the exec call (i.e. an array initialised thus:  
> { NULL }).  In the Windows version of the call, it appears that a  
> null pointer is passed to CreateProcW.  Here's the Microsoft  
> documentation for the environment parameter:
>
> "[in] A pointer to the environment block for the new process. If  
> this parameter is NULL, the new process uses the environment of the  
> calling process."
>
> http://msdn2.microsoft.com/en-us/library/ms682425.aspx

Thanks for finding that. Is there equivalent information for UNIX- 
like operating systems?

I'm not familiar with the way APR works or is supposed to work. This  
page does not specify what the behavior is supposed to be when the  
env is null:

http://apr.apache.org/docs/apr/1.2/ 
group__apr__thread__proc.html#gb51dd90b98d365a969f0ec5c7bef4e14

Is there any other APR documentation?

I assume, though, that APR functions should generally behave the same  
on all platforms, due to the word "portable" in the project's name.

I searched the Apache bugzilla for "apr_proc_create" and didn't find  
anything that looked relevant.

Is there someone already on the APR list who could ask them? Or  
should we just submit a bug report?


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

Re: hook script basics

Posted by Jeremy Pereira <je...@jeremyp.net>.
On 6 Aug 2007, at 11:19, Ryan Schmidt wrote:

> On Aug 5, 2007, at 11:08, Brian Krusic wrote:
>
>>
> Yes, the env is empty on UNIX-like systems, but I've heard it  
> reported here before that on Windows the env is not empty. I'd call  
> that a bug; Subversion should empty the env on Windows systems too,  
> to be consistent, and since the Book says the env is empty for  
> security reasons.
>
> Can we agree that this is a bug? I couldn't find one filed in the  
> issue tracker.

If it is a bug, it's an APR bug.  Subversion passes a null  
environment pointer to apr_proc_create and my cursory inspection of  
the Windows and Unix versions of this function is that the semantics  
are different.

On Unix, if the environment pointer is null, a pointer to an empty  
array is passed to the exec call (i.e. an array initialised thus:  
{ NULL }).  In the Windows version of the call, it appears that a  
null pointer is passed to CreateProcW.  Here's the Microsoft  
documentation for the environment parameter:

"[in] A pointer to the environment block for the new process. If this  
parameter is NULL, the new process uses the environment of the  
calling process."

http://msdn2.microsoft.com/en-us/library/ms682425.aspx

>
>
>> The actual problem was that Apache is normally run as the SYSTEM  
>> user so I changed it to run as a user having access privs to the  
>> repo and it worked.
>
> I'm glad you got the problem resolved.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

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

Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi Ryan,

Call it a bug if you like but I like the env being intact as is :)

I do understand that by keeping propagating the env from Windows,  
that problems can occur from mis config'd systems,etc... (some thing  
common in batch queuing systems).

However it made my life easier.

If you want to confirm, create a post hook with;

set >> c:\temp\foo.txt

And for the record, I would rather have had the repo server on Unix  
however it was already in place when I started at my current gig.

-Brian

On Aug 5, 2007, at 7:19 PM, Ryan Schmidt wrote:

> On Aug 5, 2007, at 11:08, Brian Krusic wrote:
>
>> On Aug 5, 2007, at 7:21 AM, Brian E. Fox wrote:
>>> On windows, the hooks are executed with no env set. This means  
>>> you need to define any vars that are expected inside you bat  
>>> file. It is also why something may work when you run it manually  
>>> but not as a hook.
>>
>> The problem wasn't the env however I ran "set" and redirected it  
>> to a file in a hook script and found the complete env in Windows  
>> was set contrary to the docs.
>
> Yes, the env is empty on UNIX-like systems, but I've heard it  
> reported here before that on Windows the env is not empty. I'd call  
> that a bug; Subversion should empty the env on Windows systems too,  
> to be consistent, and since the Book says the env is empty for  
> security reasons.
>
> Can we agree that this is a bug? I couldn't find one filed in the  
> issue tracker.
>
>
>> The actual problem was that Apache is normally run as the SYSTEM  
>> user so I changed it to run as a user having access privs to the  
>> repo and it worked.
>
> I'm glad you got the problem resolved.
>
>


Re: hook script basics

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 5, 2007, at 11:08, Brian Krusic wrote:

> On Aug 5, 2007, at 7:21 AM, Brian E. Fox wrote:
>> On windows, the hooks are executed with no env set. This means you  
>> need to define any vars that are expected inside you bat file. It  
>> is also why something may work when you run it manually but not as  
>> a hook.
>
> The problem wasn't the env however I ran "set" and redirected it to  
> a file in a hook script and found the complete env in Windows was  
> set contrary to the docs.

Yes, the env is empty on UNIX-like systems, but I've heard it  
reported here before that on Windows the env is not empty. I'd call  
that a bug; Subversion should empty the env on Windows systems too,  
to be consistent, and since the Book says the env is empty for  
security reasons.

Can we agree that this is a bug? I couldn't find one filed in the  
issue tracker.


> The actual problem was that Apache is normally run as the SYSTEM  
> user so I changed it to run as a user having access privs to the  
> repo and it worked.

I'm glad you got the problem resolved.

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

Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi Brian,

The problem wasn't the env however I ran "set" and redirected it to a  
file in a hook script and found the complete env in Windows was set  
contrary to the docs.

The actual problem was that Apache is normally run as the SYSTEM user  
so I changed it to run as a user having access privs to the repo and  
it worked.

-Brian


On Aug 5, 2007, at 7:21 AM, Brian E. Fox wrote:

> On windows, the hooks are executed with no env set. This means you  
> need to define any vars that are expected inside you bat file. It  
> is also why something may work when you run it manually but not as  
> a hook.
>
>
>
> From: Brian Krusic [mailto:brian@krusic.com]
> Sent: Wednesday, August 01, 2007 10:19 PM
> To: Ryan Schmidt
> Cc: users@subversion.tigris.org
> Subject: Re: hook script basics
>
>
>
> Hi Ryan,
>
>
>
> In the post-commit file, I only have del f:\temp\foo
>
>
>
> ... which worked upon committing a file.
>
>
>
> I then placed;
>
>
>
> svn info f:\jobs\cooljobs >> c:\temp\foo.txt
>
>
>
> .. and it worked.
>
>
>
> Why isn't svn update working while as a post hook?  i did choose to  
> cache creds to simplify things.  It does work as a stand alone  
> batch file.
>
>
>
> -Brian
>
>
>
>
>
>
> On Aug 1, 2007, at 5:37 PM, Ryan Schmidt wrote:
>
>
>
>
> On Aug 1, 2007, at 18:27, Brian Krusic wrote:
>
>
>
> On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:
>
>
>
> On Aug 1, 2007, at 16:19, Brian Krusic wrote:
>
>
>
> I've implemented a few hook scripts in the past; checking case,  
> forcing log messages and sending emails about the commits.
>
>
>
> However it appears I just implemented this stuff w/o understanding it.
>
>
>
> * problem *
>
>
>
> I have a simple post-commit.bat file which contains commands I want  
> to call.
>
>
>
> In my case the contents of the post commit is;
>
>
>
> @echo off
>
> C:\Progra~1\Subversion\bin\svn update --username foo --password bar  
> --no-auth-cache F:\Jobs\Cooljob
>
>
>
>
>
> The F:\Jobs\Cooljobs is the local dir that sits on the repo server  
> itself as I checked out the repo on the same PC.
>
>
>
> The username/pass is used for example only.
>
>
>
> The file works if I exe it from a cli on the repo server but not  
> when I commit from another PC.
>
>
>
> I expect it to work like so;
>
>
>
> 1 - User commits a file from some workstation.
>
> 2 - Repo executes the post commit which updates a checked out copy  
> on the server itself.
>
>
>
> Should work, provided you're checking out via http(s) or svn(+ssh).  
> Not sure how it is on Windows, but on UNIX, you'd also need to make  
> sure that the permissions of F:\Jobs\Cooljobs are such that the  
> user under which your repository is served is allowed to modify  
> that directory.
>
>
>
> Is there any thing else I am missing?
>
>
>
> Any error log I can check?
>
>
>
> Apache logs show no errors.
>
>
>
> When I run the post-commit.bat from the command line, it does  
> work.  Its as though the post-commit.bat isn't being tickled or I  
> cannot see the error.
>
>
>
> There is no hook script error log. If you want something logged,  
> you must do it yourself in your hook script.
>
>
>
> Try a minimal hook script that does nothing other than appending  
> something to a logfile, stored in a location you know everyone has  
> write access to. On UNIX I would suggest the /tmp directory; I'm  
> sure there's an equivalent on Windows.
>
>
>
>
>
>
>
>
>
>
>
>
>
>


RE: Re: hook script basics

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
On windows, the hooks are executed with no env set. This means you need
to define any vars that are expected inside you bat file. It is also why
something may work when you run it manually but not as a hook.

 

From: Brian Krusic [mailto:brian@krusic.com] 
Sent: Wednesday, August 01, 2007 10:19 PM
To: Ryan Schmidt
Cc: users@subversion.tigris.org
Subject: Re: hook script basics

 

Hi Ryan,

 

In the post-commit file, I only have del f:\temp\foo

 

... which worked upon committing a file.

 

I then placed;

 

svn info f:\jobs\cooljobs >> c:\temp\foo.txt

 

.. and it worked.

 

Why isn't svn update working while as a post hook?  i did choose to
cache creds to simplify things.  It does work as a stand alone batch
file.

 

-Brian





 

On Aug 1, 2007, at 5:37 PM, Ryan Schmidt wrote:





On Aug 1, 2007, at 18:27, Brian Krusic wrote:

 

	On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:

	 

		On Aug 1, 2007, at 16:19, Brian Krusic wrote:

		 

			I've implemented a few hook scripts in the past;
checking case, forcing log messages and sending emails about the
commits.

			 

			However it appears I just implemented this stuff
w/o understanding it.

			 

			* problem *

			 

			I have a simple post-commit.bat file which
contains commands I want to call.

			 

			In my case the contents of the post commit is;

			 

			@echo off

			C:\Progra~1\Subversion\bin\svn update --username
foo --password bar --no-auth-cache F:\Jobs\Cooljob

			 

			 

			The F:\Jobs\Cooljobs is the local dir that sits
on the repo server itself as I checked out the repo on the same PC.

			 

			The username/pass is used for example only.

			 

			The file works if I exe it from a cli on the
repo server but not when I commit from another PC.

			 

			I expect it to work like so;

			 

			1 - User commits a file from some workstation.

			2 - Repo executes the post commit which updates
a checked out copy on the server itself.

		 

		Should work, provided you're checking out via http(s) or
svn(+ssh). Not sure how it is on Windows, but on UNIX, you'd also need
to make sure that the permissions of F:\Jobs\Cooljobs are such that the
user under which your repository is served is allowed to modify that
directory.

	 

	Is there any thing else I am missing?

	 

	Any error log I can check?

	 

	Apache logs show no errors.

	 

	When I run the post-commit.bat from the command line, it does
work.  Its as though the post-commit.bat isn't being tickled or I cannot
see the error.

 

There is no hook script error log. If you want something logged, you
must do it yourself in your hook script.

 

Try a minimal hook script that does nothing other than appending
something to a logfile, stored in a location you know everyone has write
access to. On UNIX I would suggest the /tmp directory; I'm sure there's
an equivalent on Windows.

 

 

 

 

 

 


Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi Taylor,

It very well could be a perm issue.

How do I check Apache for this issue?

I feel that since I can update outside of using the hook script, that  
Apache is config'd correctly.

-Brian

On Aug 2, 2007, at 5:06 AM, Tyler Lawson wrote:

> The only thing I can think of in this case is permissions.
>
> On a linux based system, I occasionally have this problem where it  
> doesn't
> update in the post-commit and it's always permissions.
>
> I don't know how windows works, but I'd definitely suggest looking  
> into how
> apache is running and if it's allowed to write to the working copy.
>
> --Tyler
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.476 / Virus Database: 269.11.0/929 - Release Date:  
> 7/31/2007
> 5:26 PM
>
>
>

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

RE: hook script basics

Posted by Tyler Lawson <ty...@n49.com>.
The only thing I can think of in this case is permissions.

On a linux based system, I occasionally have this problem where it doesn't
update in the post-commit and it's always permissions.

I don't know how windows works, but I'd definitely suggest looking into how
apache is running and if it's allowed to write to the working copy.

--Tyler

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.0/929 - Release Date: 7/31/2007
5:26 PM
 

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

Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi Ryan,

In the post-commit file, I only have del f:\temp\foo

... which worked upon committing a file.

I then placed;

svn info f:\jobs\cooljobs >> c:\temp\foo.txt

.. and it worked.

Why isn't svn update working while as a post hook?  i did choose to  
cache creds to simplify things.  It does work as a stand alone batch  
file.

-Brian


On Aug 1, 2007, at 5:37 PM, Ryan Schmidt wrote:

> On Aug 1, 2007, at 18:27, Brian Krusic wrote:
>
>> On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:
>>
>>> On Aug 1, 2007, at 16:19, Brian Krusic wrote:
>>>
>>>> I've implemented a few hook scripts in the past; checking case,  
>>>> forcing log messages and sending emails about the commits.
>>>>
>>>> However it appears I just implemented this stuff w/o  
>>>> understanding it.
>>>>
>>>> * problem *
>>>>
>>>> I have a simple post-commit.bat file which contains commands I  
>>>> want to call.
>>>>
>>>> In my case the contents of the post commit is;
>>>>
>>>> @echo off
>>>> C:\Progra~1\Subversion\bin\svn update --username foo --password  
>>>> bar --no-auth-cache F:\Jobs\Cooljob
>>>>
>>>>
>>>> The F:\Jobs\Cooljobs is the local dir that sits on the repo  
>>>> server itself as I checked out the repo on the same PC.
>>>>
>>>> The username/pass is used for example only.
>>>>
>>>> The file works if I exe it from a cli on the repo server but not  
>>>> when I commit from another PC.
>>>>
>>>> I expect it to work like so;
>>>>
>>>> 1 - User commits a file from some workstation.
>>>> 2 - Repo executes the post commit which updates a checked out  
>>>> copy on the server itself.
>>>
>>> Should work, provided you're checking out via http(s) or svn 
>>> (+ssh). Not sure how it is on Windows, but on UNIX, you'd also  
>>> need to make sure that the permissions of F:\Jobs\Cooljobs are  
>>> such that the user under which your repository is served is  
>>> allowed to modify that directory.
>>
>> Is there any thing else I am missing?
>>
>> Any error log I can check?
>>
>> Apache logs show no errors.
>>
>> When I run the post-commit.bat from the command line, it does  
>> work.  Its as though the post-commit.bat isn't being tickled or I  
>> cannot see the error.
>
> There is no hook script error log. If you want something logged,  
> you must do it yourself in your hook script.
>
> Try a minimal hook script that does nothing other than appending  
> something to a logfile, stored in a location you know everyone has  
> write access to. On UNIX I would suggest the /tmp directory; I'm  
> sure there's an equivalent on Windows.
>
>
>
>
>


Re: hook script basics

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 1, 2007, at 18:27, Brian Krusic wrote:

> On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:
>
>> On Aug 1, 2007, at 16:19, Brian Krusic wrote:
>>
>>> I've implemented a few hook scripts in the past; checking case,  
>>> forcing log messages and sending emails about the commits.
>>>
>>> However it appears I just implemented this stuff w/o  
>>> understanding it.
>>>
>>> * problem *
>>>
>>> I have a simple post-commit.bat file which contains commands I  
>>> want to call.
>>>
>>> In my case the contents of the post commit is;
>>>
>>> @echo off
>>> C:\Progra~1\Subversion\bin\svn update --username foo --password  
>>> bar --no-auth-cache F:\Jobs\Cooljob
>>>
>>>
>>> The F:\Jobs\Cooljobs is the local dir that sits on the repo  
>>> server itself as I checked out the repo on the same PC.
>>>
>>> The username/pass is used for example only.
>>>
>>> The file works if I exe it from a cli on the repo server but not  
>>> when I commit from another PC.
>>>
>>> I expect it to work like so;
>>>
>>> 1 - User commits a file from some workstation.
>>> 2 - Repo executes the post commit which updates a checked out  
>>> copy on the server itself.
>>
>> Should work, provided you're checking out via http(s) or svn 
>> (+ssh). Not sure how it is on Windows, but on UNIX, you'd also  
>> need to make sure that the permissions of F:\Jobs\Cooljobs are  
>> such that the user under which your repository is served is  
>> allowed to modify that directory.
>
> Is there any thing else I am missing?
>
> Any error log I can check?
>
> Apache logs show no errors.
>
> When I run the post-commit.bat from the command line, it does  
> work.  Its as though the post-commit.bat isn't being tickled or I  
> cannot see the error.

There is no hook script error log. If you want something logged, you  
must do it yourself in your hook script.

Try a minimal hook script that does nothing other than appending  
something to a logfile, stored in a location you know everyone has  
write access to. On UNIX I would suggest the /tmp directory; I'm sure  
there's an equivalent on Windows.




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

Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi Ryan,

I wrote a bunch of psuedo code that kicks off batch queuing of  
animation renders, comp renders and final quicktime generation which  
are all based on values in the SVN log file.

This whole process was going to start by a commit so I'm sorta hozed  
right now.

Is there anything at all I can look at for better debug?

-Brian

On Aug 1, 2007, at 4:27 PM, Brian Krusic wrote:

> Hi Ryan,
>
> Is there any thing else I am missing?
>
> Any error log I can check?
>
> Apache logs show no errors.
>
> When I run the post-commit.bat from the command line, it does  
> work.  Its as though the post-commit.bat isn't being tickled or I  
> cannot see the error.
>
>
> -Brian
>
>
> On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:
>
>> On Aug 1, 2007, at 16:19, Brian Krusic wrote:
>>
>>> I've implemented a few hook scripts in the past; checking case,  
>>> forcing log messages and sending emails about the commits.
>>>
>>> However it appears I just implemented this stuff w/o  
>>> understanding it.
>>>
>>> * problem *
>>>
>>> I have a simple post-commit.bat file which contains commands I  
>>> want to call.
>>>
>>> In my case the contents of the post commit is;
>>>
>>> @echo off
>>> C:\Progra~1\Subversion\bin\svn update --username foo --password  
>>> bar --no-auth-cache F:\Jobs\Cooljob
>>>
>>>
>>> The F:\Jobs\Cooljobs is the local dir that sits on the repo  
>>> server itself as I checked out the repo on the same PC.
>>>
>>> The username/pass is used for example only.
>>>
>>> The file works if I exe it from a cli on the repo server but not  
>>> when I commit from another PC.
>>>
>>> I expect it to work like so;
>>>
>>> 1 - User commits a file from some workstation.
>>> 2 - Repo executes the post commit which updates a checked out  
>>> copy on the server itself.
>>
>> Should work, provided you're checking out via http(s) or svn 
>> (+ssh). Not sure how it is on Windows, but on UNIX, you'd also  
>> need to make sure that the permissions of F:\Jobs\Cooljobs are  
>> such that the user under which your repository is served is  
>> allowed to modify that directory.
>>
>>
>>
>>
>


Re: hook script basics

Posted by Brian Krusic <br...@krusic.com>.
Hi Ryan,

Is there any thing else I am missing?

Any error log I can check?

Apache logs show no errors.

When I run the post-commit.bat from the command line, it does work.   
Its as though the post-commit.bat isn't being tickled or I cannot see  
the error.


-Brian


On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:

> On Aug 1, 2007, at 16:19, Brian Krusic wrote:
>
>> I've implemented a few hook scripts in the past; checking case,  
>> forcing log messages and sending emails about the commits.
>>
>> However it appears I just implemented this stuff w/o understanding  
>> it.
>>
>> * problem *
>>
>> I have a simple post-commit.bat file which contains commands I  
>> want to call.
>>
>> In my case the contents of the post commit is;
>>
>> @echo off
>> C:\Progra~1\Subversion\bin\svn update --username foo --password  
>> bar --no-auth-cache F:\Jobs\Cooljob
>>
>>
>> The F:\Jobs\Cooljobs is the local dir that sits on the repo server  
>> itself as I checked out the repo on the same PC.
>>
>> The username/pass is used for example only.
>>
>> The file works if I exe it from a cli on the repo server but not  
>> when I commit from another PC.
>>
>> I expect it to work like so;
>>
>> 1 - User commits a file from some workstation.
>> 2 - Repo executes the post commit which updates a checked out copy  
>> on the server itself.
>
> Should work, provided you're checking out via http(s) or svn(+ssh).  
> Not sure how it is on Windows, but on UNIX, you'd also need to make  
> sure that the permissions of F:\Jobs\Cooljobs are such that the  
> user under which your repository is served is allowed to modify  
> that directory.
>
>
>
>


Re: hook script basics

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 1, 2007, at 16:19, Brian Krusic wrote:

> I've implemented a few hook scripts in the past; checking case,  
> forcing log messages and sending emails about the commits.
>
> However it appears I just implemented this stuff w/o understanding it.
>
> * problem *
>
> I have a simple post-commit.bat file which contains commands I want  
> to call.
>
> In my case the contents of the post commit is;
>
> @echo off
> C:\Progra~1\Subversion\bin\svn update --username foo --password bar  
> --no-auth-cache F:\Jobs\Cooljob
>
>
> The F:\Jobs\Cooljobs is the local dir that sits on the repo server  
> itself as I checked out the repo on the same PC.
>
> The username/pass is used for example only.
>
> The file works if I exe it from a cli on the repo server but not  
> when I commit from another PC.
>
> I expect it to work like so;
>
> 1 - User commits a file from some workstation.
> 2 - Repo executes the post commit which updates a checked out copy  
> on the server itself.

Should work, provided you're checking out via http(s) or svn(+ssh).  
Not sure how it is on Windows, but on UNIX, you'd also need to make  
sure that the permissions of F:\Jobs\Cooljobs are such that the user  
under which your repository is served is allowed to modify that  
directory.



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