You can't. The commit does not yet exist so there's nothing to get.
You can come pretty close: use the same rules that git commit
uses to pick a default author and committer, i.e., look for GIT_AUTHOR_NAME
, GIT_AUTHOR_EMAIL
, GIT_COMMITTER_NAME
, and GIT_COMMITTER_EMAIL
in the environment, and if not set, use git config --get user.name
, etc., to get the settings. But this does not seem to capture any --author=
argument to a git commit
command.