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

Expose verbose and debug flags to vcsh hooks? #175

Closed
nfarrar opened this issue Aug 16, 2015 · 11 comments · Fixed by #291
Closed

Expose verbose and debug flags to vcsh hooks? #175

nfarrar opened this issue Aug 16, 2015 · 11 comments · Fixed by #291

Comments

@nfarrar
Copy link

nfarrar commented Aug 16, 2015

Would it be possible to expose the debug and verbose flags to vcsh hooks?

@vdemeester
Copy link
Contributor

@nfarrar I think this could be done and would be cool 😉

@nfarrar
Copy link
Author

nfarrar commented Aug 18, 2015

Right now I've added a bunch of verbose information to my hooks (for testing while writing them) ... it'd be nice to leave those in now that they're working and have it hidden except when needed (i.e. something breaks).

@vdemeester
Copy link
Contributor

@nfarrar yeah that's an idea 👍. I tend to use that on my usual git repository (with a little message to know it's working though 😝).

@nfarrar
Copy link
Author

nfarrar commented Nov 10, 2015

Just checking back in on this. :) Rewrote my hooks with some configurable verbosity. Would be awesome to expose these options to them:

@ao2
Copy link

ao2 commented May 7, 2018

Right now hooks are child processes, in principle they could be written in any programming language.

If this will stays that way the best that can be done is to export the env variables VCSH_VERBOSE and VCSH_DEBUG and have hooks use them as they wish.

@alerque
Copy link
Collaborator

alerque commented Apr 3, 2021

cf. #68 for another way of making hooks powerful, and cf. #276 for another variable export related feature request. One feature can probably cover both this and #276 by doing by default for hooks whatever the new vcsh dump_vars does.

RichiH added a commit that referenced this issue Apr 5, 2021
This makes it possible to react to verbose and debug state from hooks.

Fixes: #175

Signed-off-by: Richard Hartmann <[email protected]>
@RichiH
Copy link
Owner

RichiH commented Apr 5, 2021

The one risk I can see is that -v and -d might do different things for hooks, in particular after a decade of organic growth. Sorry for not engaging with this a lot earlier.

@ao2 @nfarrar @vdemeester What about #291 ? Does that help with your use case?

@RichiH
Copy link
Owner

RichiH commented Apr 5, 2021

Trivial test hook script to verify:

echo hookscript $0
echo "debug: $VCSH_DEBUG"
echo "verbose: $VCSH_VERBOSE"

@alerque
Copy link
Collaborator

alerque commented Apr 5, 2021

Yes. I think exposing these via the environment variables rather than passing them any CLI flags is the right thing to do. This will also translate nicely to #276.

@RichiH
Copy link
Owner

RichiH commented Apr 5, 2021

As an update, #292 is an even more aggressive interpretation of this feature request. This should cover ALL that things.

@ao2
Copy link

ao2 commented Apr 11, 2021

Thanks folks, this looks nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants