Stash - Repository Templates?

Igor Masen July 21, 2013

Hello

today we are running "plain-git" installation with some shell scripts, which help us to procure standardised git repositories with specific update-hooks. Those hooks validate the author entry in a git-commit and deny them if they do not match ldap-entries. We found the "Enforce Author Hook for Stash"-PlugIn which would provide a simliar functionality, but we need to activate it for every new repository, which is error-prone. Is there a possiblity in Stash to provide a "template"-configuration, so new created repository has the same hooks enabled with the same configuration?

2 answers

2 votes
Gurleen Anand [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2013

Hi Igor,

Unfortunately this feature is not yet available in Stash, though you can track its progress here:

https://jira.atlassian.com/browse/STASH-3597

by watching it and casting your vote there. For your reference this is how new features are prioritized in Stash:https://confluence.atlassian.com/display/STASH/New+features+policy

Thanks,

Gurleen

1 vote
David Everlof December 4, 2013

If it's native git hooks you want to add to newly created repositories you can just add them to:

/usr/share/git-core/templates/hooks
or
C:\Program Files\Git\share\git-core\templates\hooks

depending on system, and they'll be added to repos inited by Stash.

/David

cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 5, 2013

Just to repeat a comment that's on the Stash-3597 issue above. If you do decide to add hooks to the default templates directory, make sure they're in a post-receive.d or pre-receive.d directories. Stash needs to hijack the normal files and if they get overriden by Git then Stash will stop behaving as expected. That said what would most likely happen is that Stash would override your default hooks every time, which wouldn't be desirable either.

Cheers,

Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events