Git push, streaming message to client terminal
Let's say I have a git server. On every click I need to start a process and I can do it with a hook.
You need to write the stdout process to the git client that did the push. This is very similar to pushing Heroku or Openshift.
Question: how to send text streams / message back to the git client so that it can print it to the terminal?
source to share
The Git hook page mentions:
Both standard output and standard error output are sent at
git send-pack
the other end, so you can justecho
post messages to the user.
Don't forget to add set -x
if you want to see all the commands executed by your script.
source to share
While @ VonC's answer was perfect for me, I also came across a library that helps in this case.
Gitreceived is part of the Flynn project:
An SSH server built specifically to accept git pushes, which will run an auth script and then a receiver script to handle the push.
source to share