Replies: 1 comment 3 replies
-
|
If we support this, I think we should either
Not a fan of such a specialized flag as |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related to #484, it occurred to me that it is actually possible to check the allowed author in --file mode too at least when running in a git commit-msg hook which I think is quite a common scenario: git sets the
GIT_AUTHOR_NAMEandGIT_AUTHOR_EMAILenv vars, and those could be combined to create an author string on the fly to check against,$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>.I don't know if there are some gnarly escaping details re this when git does it internally, but I suppose it's not a biggie even if there are -- that might be very well possible to take care of in the allowed_author_re regexp.
Maybe it would be best to add a command line flag for opting in to the env lookup, so that it would not take effect when one does a commit message check (with --file or stdin) in some other context and GIT_AUTHOR_* from the env kick in even though they might not have anything to do with the commit. So maybe a --author-from-env flag which enables this, and the committed pre-commit hook and other commit hook setups could make use of it? The flag would not have any effect when checking against a complete commit.
Beta Was this translation helpful? Give feedback.
All reactions