diff options
-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 |