Re: [gitorious] Adding functionality to repository creation

2012-08-01 Thread Rachel Harris
Thanks. This is exactly where I thought it should be. My main issue was 
that the changes I made there didn't appear to be executing. Eventually I 
figured out that I needed to restart the stompserver to get the changes to 
take effect.


On Tuesday, July 31, 2012 10:59:48 PM UTC-7, Marius Mårnes Mathiesen wrote:

 On Tue, Jul 31, 2012 at 7:54 PM, Rachel Harris 
 rachel.anne.har...@gmail.com wrote:

 I would like to have a default file get generated in every new repo that 
 is created by users of my Gitorious installation. I think I'm pretty clear 
 on the code to do this (i.e. using Repository.git.add, etc...). My problem 
 is figuring out *where* to put this code.

 I know I can't put my code into the creation of the repository object 
 (e.g. with an after_create method in Repository) because the actual repo 
 creation is done asynchronously by stompserver. 
 Repository.post_repo_creation_message appears to set things up so that 
 Repository.create_git_repository will be executed by stompserver, but my 
 testing so far shows that Repository.create_git_repository is never being 
 called, even though the repositories are being generated just fine.


 Rachel,
 Here's roughly how it works:
 - After a repository is created, `post_repo_creation_message` is called
 - This will send a message to the message queue, containing (among other 
 things) the command to be run: `create_git_repository`
 - This message is picked up by 
 app/processors/repository_creation_processor.rb, which will actually 
 perform Repository.create_git_repository

 Repository.create_git_repository will:
 - create the repository on disk
 - create the hooks required by Gitorious (it will create a symlink to the 
 shared hooks directory in Gitorious)

 This would probably be a natural place to add your code. 

 Cheers,
 - Marius


-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com


[gitorious] Adding functionality to repository creation

2012-07-31 Thread Rachel Harris
I would like to have a default file get generated in every new repo that is 
created by users of my Gitorious installation. I think I'm pretty clear on 
the code to do this (i.e. using Repository.git.add, etc...). My problem is 
figuring out *where* to put this code.

I know I can't put my code into the creation of the repository object (e.g. 
with an after_create method in Repository) because the actual repo creation 
is done asynchronously by stompserver. 
Repository.post_repo_creation_message appears to set things up so that 
Repository.create_git_repository will be executed by stompserver, but my 
testing so far shows that Repository.create_git_repository is never being 
called, even though the repositories are being generated just fine.

What am I not seeing here?

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com


Re: [gitorious] Adding functionality to repository creation

2012-07-31 Thread Marius Mårnes Mathiesen
On Tue, Jul 31, 2012 at 7:54 PM, Rachel Harris rachel.anne.har...@gmail.com
 wrote:

 I would like to have a default file get generated in every new repo that
 is created by users of my Gitorious installation. I think I'm pretty clear
 on the code to do this (i.e. using Repository.git.add, etc...). My problem
 is figuring out *where* to put this code.

 I know I can't put my code into the creation of the repository object
 (e.g. with an after_create method in Repository) because the actual repo
 creation is done asynchronously by stompserver.
 Repository.post_repo_creation_message appears to set things up so that
 Repository.create_git_repository will be executed by stompserver, but my
 testing so far shows that Repository.create_git_repository is never being
 called, even though the repositories are being generated just fine.


Rachel,
Here's roughly how it works:
- After a repository is created, `post_repo_creation_message` is called
- This will send a message to the message queue, containing (among other
things) the command to be run: `create_git_repository`
- This message is picked up by
app/processors/repository_creation_processor.rb, which will actually
perform Repository.create_git_repository

Repository.create_git_repository will:
- create the repository on disk
- create the hooks required by Gitorious (it will create a symlink to the
shared hooks directory in Gitorious)

This would probably be a natural place to add your code.

Cheers,
- Marius

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com