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

Reply via email to