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
Getting the information of what is to be pushed in pre-push hook #1908
Comments
yeah it's ~generally not possible within the framework which makes some (potentially incorrect) assumptions that you're pushing the checked out commit -- as far as I can tell it has always been this way 🤷 |
Thank you for your response. For my use case that is too bad, but there is probably a good reason for it. Either way, would you mind me having a look to see if I can add this feature without breaking or altering the design? If you believe it to be possible, of course. |
I don't think it's possible within the framework, but feel free to have a look |
Alright. I will have a gander and make a comment my findings. |
The issue that @Jonas-Visma and I are trying to solve, is to get the stdin data passed on to the plugin so we can validate branch and tag names. Either by getting data via stdin or via environment variables. So I have an easy solution to our problem, which only involves modifying hook_impl.py, so the pre-push plugins are called once for each branch to be pushed. |
not really, that will trigger hooks on unrelated code (and many times) you could use a legacy hook which would receive the full stdin, but that'd be outside the framework |
As mentioned in #1410, some of the information given to pre-push from git is missing. Unlike #1410 I am wondering whether it is possible to get the information about every single commit about to be pushed?
I suspect that this is currently not possible, based on #693 and the function _pre_push_ns. Which seems to discard this information.
Is this a feature that would be possible to incorporate in the design of
pre-commit
? Or is there a work around I am not seeing? The work around should preferably still utilize this awesome framework so the pre-push wouldn't have to be manually setup.The text was updated successfully, but these errors were encountered: