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

Documentation for /dev/stdin ? #136

Open
byteduty opened this issue Feb 20, 2023 · 2 comments
Open

Documentation for /dev/stdin ? #136

byteduty opened this issue Feb 20, 2023 · 2 comments

Comments

@byteduty
Copy link

The example in the Debug scripts lists parameters passed via STDIN. I've been searching through all the documentation and other than mentions of GLOBAL VARIABLES and potential positional parameters I cannot find the details of the STDIN data. PLease can you point me to this, or document this?

Many apologies if it's just I've missed this multiple times

Colin.

@kovetskiy
Copy link
Member

Hey, no worries, the scripts receive the standard git hooks stdin format, for example, for pre-receive:
https://git-scm.com/docs/githooks#pre-receive

Here is an example where I use this stdin: https://external-hooks.reconquest.io/docs/example.bitbucket-add_hook_javascript_linter/#setting-up-hook

@byteduty
Copy link
Author

@kovetskiy Thank you for the prompt confirmation, this makes sense.

It might be worth adding a sub-heading in the documentation to just clarify that in addition to the ENVIRONMENT VARIABLES, the standard Git hook stdin, as you've pointed out above is provided too the script:

This hook executes once for the receive operation. It takes no arguments, but for each ref to be updated it receives on standard input a line of the format:

SP SP LF
where is the old object name stored in the ref, is the new object name to be stored in the ref and is the full name of the ref. When creating a new ref, is the all-zeroes object name.

Many thanks.

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

No branches or pull requests

2 participants