diff options
Diffstat (limited to 'commit.d/50vcs-commit')
-rwxr-xr-x | commit.d/50vcs-commit | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit index 89aa6c6..55f0db2 100755 --- a/commit.d/50vcs-commit +++ b/commit.d/50vcs-commit @@ -55,11 +55,23 @@ if [ "$VCS" = git ] && [ -d .git ]; then export GIT_AUTHOR_EMAIL fi fi + if [ -z "$GIT_AUTHOR_NAME" ] || [ -z "$GIT_AUTHOR_EMAIL" ]; then + if [ -n "$USER_HOME" ] && [ -e "$USER_HOME/.config/git/config" ]; then + if [ -z "$GIT_AUTHOR_NAME" ]; then + GIT_AUTHOR_NAME="$(git config -f "$USER_HOME/.config/git/config" user.name)" || true + export GIT_AUTHOR_NAME + fi + if [ -z "$GIT_AUTHOR_EMAIL" ]; then + GIT_AUTHOR_EMAIL="$(git config -f "$USER_HOME/.config/git/config" user.email)" || true + export GIT_AUTHOR_EMAIL + fi + fi + fi + if [ -z "$GIT_COMMITTER_EMAIL" ]; then GIT_COMMITTER_EMAIL="$(git config --global user.email)" || true export GIT_COMMITTER_EMAIL fi - if [ -z "$GIT_AUTHOR_NAME" ]; then GIT_AUTHOR_NAME="$USER" export GIT_AUTHOR_NAME |