Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash extensibility w.r.t basic GIT hooks

Mohan Krishnan March 27, 2013

Hello ,

Does STASH supports standard GIT hooks other than - post receive , pre receive and merge check hooks ?

Also , Do we need to write a full scaled Atlassian plugin using the SDK to extend hook creation capability in stash ? If not what is the alternative and what type of native GIT hooks can be supported in Stash ?

Rgeards,

Mohan

2 answers

0 votes
Jens Schumacher [Atlassian]
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.
March 27, 2013

Just to clarify, there is only one "standard" Git Server-Side Hook that Stash doesn't support right now, and that's "update". All other Git hooks are Client-Side hooks and have to reside on the developers machine to hook into the actual commit for example.

0 votes
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.
March 27, 2013

Hi Mohan,

Stash currently only supports the hooks you have mentioned. Is there any specific hook that you were hoping to implement?

To use our hook API you are required to write an Atlassian Plugin. The only other alternative is to ask your system administrator to manually install scripts into the Git repositories on disk, using any of the standard hooks.

Cheers,

Charles

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.
March 27, 2013

Hi Mohan,

As I said you would need to write Stash hooks as an Atlassian Plugin using Jav a (or any JVM language - Clojure/Scala/etc). We don't really have any need at the moment for other hooks. In fact most of the remaining hooks are client-side (ie don't make sense on a bare git repository). What hooks are missing that you are hoping to implement?

Yes, adding scripts to the Stash repositories hook directory is how you would implement normal hooks.

Cheers,

Charles

Mohan Krishnan March 27, 2013

Do we need to program/script Atlassian plugin / hook API's using Java ? Does stash has a road map to support any other Standard hooks ?

As you indicated - "only other alternative is to ask your system administrator to manually install scripts into the Git repositories on disk, using any of the standard hooks" . Can this be implemented in a Stash hosted Git repository ( Modify the hook samples in \data\repositories\1\hooks ( example location ) in Stash home directory?

Mohan Krishnan March 27, 2013

I was looking for setting up time deadlines for Pull requests and email notification's on a push to the Stash server .

Regards,

Mohan

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.
March 27, 2013

I should add that if you do decide to add pre or post receive hooks into the Git repositories, please add them to hook/pre-receive.d and hooks/post-receive.d directories. We hijack the default pre-receive and post-receive scripts and these are required for our normal hooks to function.

Cheers,

Charles

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.
March 27, 2013

Hi Mohan,

Both of those requirements can be achieved using the standard pre and post receive hooks. You can do that either as scripts or full-blown Stash hooks. The latter has the extra benefit of having exposure the PullRequestService Java API and being able to make tweaks to Stash UI via web panels.

Cheers,

Charles

Mohan Krishnan March 27, 2013

what do you mean by full-blown Stash hooks. ? sorry for so many questions but just wanted to be clear since these are our primary requirements

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.
March 27, 2013

Sorry, I just meant Stash Java hooks implemented as an Atlassian plugin.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events