Say I have a git server. On every push, I need to kick off a process, and I can do this via a hook.
The need is to write the process's stdout on to the git client, who did the push. This is much similar to Heroku or Openshift push.
Question is - How do I send text streams/message back to a git client, so that it would print it on the terminal?
The Git Hook page does mention:
Both standard output and standard error output are forwarded to
git send-packon the other end, so you can simplyechomessages for the user.
Don't forget to add a set -x if you want to see all the commands executed by your script.
Although @VonC's answer was perfect for me, I also came across a library that helps in this case.
Gitreceived is a part of the Flynn project:
An SSH server made specifically for accepting git pushes that will trigger an auth script and then a receiver script to handle the push.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With