RichiH/vcsh

Document environment available to hooks

Opened this issue · 1 comments

There are many environment variables which are set and exported when the hooks run. But there is no official documentation as to what is available. This makes users to go through the code and use what they find. I am not sure if everything available in the code should really be used unless designed for that purpose and documented.

For example I would like to use VCSH_REPO_NAME in the post-clone hook to initialize any submodules in the repo. Similarly VCSH_COMMAND in the pre-command hook to identify the delete command and deinit any submodules before delete so that I do not have directories lying around even after a delete. But none of these are documented in the man page.

It will be better than nothing if we can just identify and list the valid ones in the man page.

Anything that's exported can be used in all hooks. I take it a contract which states what variables will never go away would help?

If you want, you can have a go at writing that.