The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive External Hooks

Kelsey Farenholtz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 17, 2015

I would like to add a hook that warns the user when they are pushing a binary encoded file.  I do not want to block the push explicitly, but would like to prompt the user (via the command line) that they are checking in a binary file, and allow them to interactively allow or disallow the commit via the prompt.  The documentation said there were examples on giving the user output, but was wondering if there was an example for prompting the user for information as well, or if this is even allowed with this plugin?

Thanks for your help!  Also, great plugin!

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Stanislav Seletskiy
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 Champions.
June 17, 2015

No, there is no way to read data from user, because it's not allowed by specification of git push protocol/git push command implementation.

However, you can implement simple countdown and slightly suspend push process with notifying user that he is just about of pushing binary blob.

 

I've done it for checking coding standards.

Balázs Szakmáry
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 Champions.
June 17, 2015

You need to package this as a pre-receive plugin that never rejects commits. The output you want to show to the user has to go to hookResponse.out().

Kelsey Farenholtz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 18, 2015

Thanks! I'll look into both of these methods.

TAGS
AUG Leaders

Atlassian Community Events