Stash extensibility w.r.t basic GIT hooks

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

This widget could not be displayed.

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

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

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?

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

Regards,

Mohan

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

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

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

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

This widget could not be displayed.

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Friday in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

169 views 9 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you