-
Notifications
You must be signed in to change notification settings - Fork 220
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
pre-push hook missing stdin values #147
Comments
So, I managed to get this working with the following git hook:
Note: rather than outputting a templated file with the hook name as the There's probably a better way to solve this. |
As a further note pre-push and post-push are the only two that can receive stdin when executed by git, however, git isn't always going to give you information via stdin, despite what the documentation on the pre-push hook says. If your local branch is up-to-date with the remote branch, then no line for that will be printed to stdin, which basically means you can't really use this for validating git branch names pre-push n.b., it'd be wrong to use So, end of day, whilst executing pre-push hooks with lefthook is currently broken, even if they're fixed, there's an issue in git which causes the pre-push hook to not run as expected, hence you can't use pre-push for validating branch names. |
@ThisIsMissEm A number of changes to stdin handling have been implemented in the meantime. Is this issue this current? |
No idea, I don't use the project anymore (i've changed companies twice since then!) |
It works now, I had changed our pre-push hooks the other day! Thank you 🙏 @sanmai-NL |
@ThisIsMissEm This can be closed now then, right? @carhartl See #732 |
I think so… the proof (for my case) is here: |
According to the git hooks documentation, pre-push receives a line of input from stdin, which gives the branch names:
However, the script that lefthook uses for executing pre-push doesn't forward this input through to the script.
I'm not sure what the right way to fix this is?
The text was updated successfully, but these errors were encountered: