Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output from pre-receive hook does not echo to client. #652

Closed
csimons opened this issue Feb 10, 2016 · 4 comments
Closed

Output from pre-receive hook does not echo to client. #652

csimons opened this issue Feb 10, 2016 · 4 comments

Comments

@csimons
Copy link

csimons commented Feb 10, 2016

Hook output should echo at the client side, and does indeed when using the (non-Windows) Git client, but does not echo when using git-for-windows. For verification, output from the same push for both Git for Windows and the regular Git client (from Cygwin) appears below for comparison.

pre-receive hook on server:

#!/usr/bin/env bash
echo 'foo'
exit 1

Git 2.5.3 from Cygwin distribution (correct output):

$ git version
git version 2.5.3
$ echo foo > foo
$ git add foo
$ git commit -m 'foo' > /dev/null
$ git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 267 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: foo
To git://viadevgit01/test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git://viadevgit01/test.git'
$

Note the hook output emitted in the fourth-from-last line above, "remote: foo".

Git for Windows version 2.7.0.windows.2 64-bit, run on Windows 7 (incorrect output):

$ git version
git version 2.7.0.windows.2
$ echo foo > foo
$ git add foo
$ git commit -m 'foo' > /dev/null
$ git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 267 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git://viadevgit01/test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git://viadevgit01/test.git'
$

Note that the line "remote: foo" is absent in the git-for-windows output.

@dscho
Copy link
Member

dscho commented Apr 2, 2016

Is it possible to trigger this error with a Minimal, Complete & Verifiable Example?

@csimons
Copy link
Author

csimons commented Jan 27, 2018

@dscho I'm not sure how to make this more minimal, though I'm happy to carry out any suggestions. Thoughts?

@PhilipOakley
Copy link

There was some documentation updates on the main list in this area. a quick search found this possibility https://public-inbox.org/git/[email protected]/

For the MVCE, maybe see if you can develop a very short local method of setting up the scenario. I'm guessing that creating the setup is the hardest, if one doen't have the right stuff to hand. I don't know enough about the hooks and remote service to advise here.

@dscho
Copy link
Member

dscho commented Jan 1, 2020

Git for Windows version 2.7.0.windows.2 64-bit, run on Windows 7 (incorrect output):

$ git version
git version 2.7.0.windows.2
$ echo foo > foo
$ git add foo
$ git commit -m 'foo' > /dev/null
$ git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 267 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git://viadevgit01/test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git://viadevgit01/test.git'
$

Note that the line "remote: foo" is absent in the git-for-windows output.

From another vague memory, I seem to recall that push via git:// requires the sideband to be turned off. And my guess is that that is precisely where the output would be transmitted.

There is a stalled ticket about this here: #2376. I will close this here ticket in favor of that ticket.

@dscho dscho closed this as completed Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants