pass arguments to git post-receive hooks -


as mentioned https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks, git post-receive hook doesn't take arguments. want pass one/multiple arguments post-receive script.

git push origin <branch_name> <arg1> <arg2> ...

is there way it?

no: literally impossible in cases, because git runs ssh or similar transport agent, connects host on origin's git lives, , fires different (unrelated program invocation ancestry) git on machine, runs receive processing. security reasons, these transport agents limit "attack surface area", cleaning out side channel information.

what boils down can supply "arguments" smuggling them inside pushed data. pushed—i.e., data—are new commits , objects referenced commits, , reference names (mostly branch and/or tag names).

note post-receive hook take tag name tag points standalone commit or blob contains arguments, extract arguments, delete tag. still have take care handle cases many individual sources git push-ing @ approximately same time, delivering many objects , references, including multiple tags multiple arguments, causing multiple simultaneous post-receive script runs. git locks against own updates while running pre-receive , update hooks, post-receive hook run after releasing these locks.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -