threads / bug / 53561

Bug report: Parameters for the `prepare-commit-msg` hook could use better documentation.

Subject: Bug report: Parameters for the `prepare-commit-msg` hook could use better documentation.

## tl;dr

One message between May 26, 2020 and May 26, 2020.

replies: 0people: 1as markdown or json

Dan Rose· May 26, 2020, 23:43 UTC · lore

Bug report: Parameters for the `prepare-commit-msg` hook could use better documentation.

1. It's not clear under which circumstances the number of parameters
varies (e.g. "When there is no initial commit message text, the hook
gets one parameter. When the commit message is derived from another
commit, the hook gets three parameters. In all other cases, the hook
gets two parameters)
2. It is hard to tell what third parameter's relation to the preceding
list of commit message sources. Replacing the list with just the third
item shows that, grammatically, the documentation says the SHA-1 is
part of the second parameter: "The second is the source of the commit
message, and can be ... commit, followed by a commit SHA-1 (if a -c,
-C or --amend option was given)."
3. The types of values the third parameter can take include "HEAD", an
unambiguous sha-1 prefix, or seemingly any type of commit reference.
This is not documented.

← back to recent threads