Srikanth Venugopalan
Srikanth Venugopalan

Reputation: 9049

Git push, stream message to client terminal

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?

Upvotes: 3

Views: 457

Answers (2)

Srikanth Venugopalan
Srikanth Venugopalan

Reputation: 9049

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.

Upvotes: 3

VonC
VonC

Reputation: 1327902

The Git Hook page does mention:

Both standard output and standard error output are forwarded to git send-pack on the other end, so you can simply echo messages for the user.

Don't forget to add a set -x if you want to see all the commands executed by your script.

Upvotes: 3

Related Questions