{"thread":{"id":"22932","subject":"git-http-backend: hook output not delivered to client","startedAt":"2010-03-06T22:24:27Z","lastAt":"2010-03-06T22:53:08Z","messageCount":3,"participants":["BJ Hargrave","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136246","messageId":"3C07BFC0-BC5E-4901-A846-A337B5F1B8F4@bjhargrave.com","threadId":"22932","inReplyTo":null,"subject":"git-http-backend: hook output not delivered to client","fromName":"BJ Hargrave","fromEmail":"bj@bjhargrave.com","sentAt":"2010-03-06T22:24:27Z","receivedAt":"2010-03-06T22:24:27Z","isPatch":false,"sender":{"key":"bj@bjhargrave.com","avatar":"https://gravatar.com/avatar/48e60c01177c0e8d3e60c996d54fbe36cf70058efcdd020375b4055e34fc05d7?d=mp&s=160"},"body":"I have compiled and installed git 1.7.0.1 on a RHEL4 box and am using Apache httpd with git-http-backend. I have developed a pre-receive hook to validate that incoming commits are from a list of committers. I have tested the hook and it correctly detects invalid committers, outputs error message and exits with a non-zero return code. \n\nIf I push a commit from an invalid committer to a repo using ssh, the hook properly detects this. git-push displays the pre-receive hook's output messages and indicates the push failed.\n\nHowever if I push a commit from an invalid committer to the repo using http (git-http-backend), the hook is run and detects the invalid committer but the output messages (stderr) end up in the httpd error log instead of being ferried back to git-push. git-push does exit with an error code but the user has no visible indication there was an error on the push. The git-push output look like everything went fine even though the push failed.\n\nSo the push properly fails in both cases because the hook exits with a non-zero return code, but it seems there is a problem with git-http-backend not ferrying the hook output messages back to the client. Has anyone seen this? Or have I some how configure the system wrong?\n\nThanks,\n-- \n\nBJ Hargrave\n"},{"id":"136247","messageId":"20100306223031.GG2529@spearce.org","threadId":"22932","inReplyTo":"3C07BFC0-BC5E-4901-A846-A337B5F1B8F4@bjhargrave.com","subject":"Re: git-http-backend: hook output not delivered to client","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-03-06T22:30:31Z","receivedAt":"2010-03-06T22:30:31Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"BJ Hargrave <bj@bjhargrave.com> wrote:\n> I have compiled and installed git 1.7.0.1 on a RHEL4 box\n... \n> So the push properly fails in both cases because the hook exits\n> with a non-zero return code, but it seems there is a problem with\n> git-http-backend not ferrying the hook output messages back to\n> the client.\n\nYes, we know about this problem.\n\nYou need commit 466dbc42f5 (\"receive-pack: Send internal errors over\nside-band #2\") on both the client and the server for hook messages\nto work over HTTP.\n\nThis hasnt been released yet.  It is slated for 1.7.0.2.\n\n-- \nShawn.\n"},{"id":"136251","messageId":"25C95FB3-B827-46F1-9355-549BD6F2BC1E@bjhargrave.com","threadId":"22932","inReplyTo":"20100306223031.GG2529@spearce.org","subject":"Re: git-http-backend: hook output not delivered to client","fromName":"BJ Hargrave","fromEmail":"bj@bjhargrave.com","sentAt":"2010-03-06T22:53:08Z","receivedAt":"2010-03-06T22:53:08Z","isPatch":false,"sender":{"key":"bj@bjhargrave.com","avatar":"https://gravatar.com/avatar/48e60c01177c0e8d3e60c996d54fbe36cf70058efcdd020375b4055e34fc05d7?d=mp&s=160"},"body":"Thanks for the quick feedback. I will keep my eye out for 1.7.0.2.\n\n-- \n\nBJ Hargrave\n\n\n\nOn Mar 6, 2010, at 17:30 , Shawn O. Pearce wrote:\n\n> BJ Hargrave <bj@bjhargrave.com> wrote:\n>> I have compiled and installed git 1.7.0.1 on a RHEL4 box\n> ... \n>> So the push properly fails in both cases because the hook exits\n>> with a non-zero return code, but it seems there is a problem with\n>> git-http-backend not ferrying the hook output messages back to\n>> the client.\n> \n> Yes, we know about this problem.\n> \n> You need commit 466dbc42f5 (\"receive-pack: Send internal errors over\n> side-band #2\") on both the client and the server for hook messages\n> to work over HTTP.\n> \n> This hasnt been released yet.  It is slated for 1.7.0.2.\n> \n> -- \n> Shawn.\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}