diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-22 14:14:28 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-22 14:14:28 -0400 |
commit | 5df9d1b98787303f724dfc4e6f423d6e2817aac3 (patch) | |
tree | 15c576d9e29116e1e42b65679b2198853dd3067e | |
parent | 1490c8d6dd94f1b58718f6bc61ba78cf8a0a2e26 (diff) |
Support ~/.config/git/config when determining the author name and email. Thanks, Richard Savio
-rwxr-xr-x | commit.d/50vcs-commit | 14 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 15 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 diff --git a/debian/changelog b/debian/changelog index ff5a644..f47b051 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ etckeeper (1.18.3) UNRELEASED; urgency=medium Thanks, Serge E. Hallyn * Fix Makefile version patterns to ignore non-native version number (Antoine Beaupré) + * Support ~/.config/git/config when determining the author name and email. + Thanks, Richard Savio -- Joey Hess <id@joeyh.name> Mon, 21 Sep 2015 16:38:03 -0400 |