summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2011-02-20 11:02:33 -0800
committerJoey Hess <joey@kitenet.net>2011-02-20 15:21:14 -0400
commit754e68fb2562468dcf5f497df869ced5eb819742 (patch)
tree7f4e9936450e2c9c428861ef4f217ff20370da9d
parent9b588106d2c3e79a888b61415e084fb093a25090 (diff)
Only set environment variables for commit authorship (EMAIL, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL) if they don't already exist.
-rwxr-xr-xcommit.d/50vcs-commit14
-rw-r--r--debian/changelog6
2 files changed, 16 insertions, 4 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit
index 6e509e6..d484626 100755
--- a/commit.d/50vcs-commit
+++ b/commit.d/50vcs-commit
@@ -41,9 +41,15 @@ fi
if [ "$VCS" = git ] && [ -d .git ]; then
if [ -n "$USER" ]; then
- export GIT_AUTHOR_NAME="$USER"
- export GIT_AUTHOR_EMAIL="$USER@$hostname"
- export GIT_COMMITTER_EMAIL=`whoami`"@$hostname"
+ if [ -z "$GIT_AUTHOR_NAME" ]; then
+ export GIT_AUTHOR_NAME="$USER"
+ fi
+ if [ -z "$GIT_AUTHOR_EMAIL" ]; then
+ export GIT_AUTHOR_EMAIL="$USER@$hostname"
+ fi
+ if [ -z "$GIT_COMMITTER_EMAIL" ]; then
+ export GIT_COMMITTER_EMAIL=`whoami`"@$hostname"
+ fi
fi
if [ -n "$logfile" ]; then
git commit $GIT_COMMIT_OPTIONS -F "$logfile"
@@ -63,7 +69,7 @@ elif [ "$VCS" = hg ] && [ -d .hg ]; then
hg commit $HG_COMMIT_OPTIONS
fi
elif [ "$VCS" = bzr ] && [ -d .bzr ]; then
- if [ -n "$USER" ]; then
+ if [ -z "$EMAIL" ] && [ -n "$USER" ]; then
export EMAIL="$USER <$USER@$hostname>"
fi
if [ -n "$logfile" ]; then
diff --git a/debian/changelog b/debian/changelog
index d929e59..246d045 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,13 @@
etckeeper (0.53) UNRELEASED; urgency=low
+ [ Joey Hess ]
* Install bzr hook lazily, clean up some compatibility code. (Jelmer Vernooij)
+ [ Josh Triplett ]
+ * Only set environment variables for commit authorship (EMAIL,
+ GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL) if they don't
+ already exist.
+
-- Joey Hess <joeyh@debian.org> Sat, 19 Feb 2011 20:02:46 -0400
etckeeper (0.52) unstable; urgency=low