tags 498739 + patch
user [email protected]
usertag 498739 + ubuntu-patch

Proposed patch to implement this.

-- 
Thierry Carrez
=== modified file 'commit.d/50vcs-commit'
--- commit.d/50vcs-commit	2008-12-31 18:02:14 +0000
+++ commit.d/50vcs-commit	2009-01-26 16:45:31 +0000
@@ -2,20 +2,32 @@
 set -e
 
 message="$1"
+author="$SUDO_USER"
+hostname=`hostname -f`
 
 if [ "$VCS" = git ] && [ -d .git ]; then
+	if [ -n "$author" ]; then
+		export GIT_AUTHOR_NAME="$author"
+		export GIT_AUTHOR_EMAIL="$aut...@$hostname"
+	fi
 	if [ -n "$message" ]; then
 		git commit $GIT_COMMIT_OPTIONS -m "$message"
 	else
 		git commit $GIT_COMMIT_OPTIONS
 	fi
 elif [ "$VCS" = hg ] && [ -d .hg ]; then
+	if [ -n "$author" ]; then
+		export LOGNAME="$author"
+	fi
 	if [ -n "$message" ]; then
 		hg commit $HG_COMMIT_OPTIONS -m "$message"
 	else
 		hg commit $HG_COMMIT_OPTIONS
 	fi
 elif [ "$VCS" = bzr ] && [ -d .bzr ]; then
+	if [ -n "$author" ]; then
+		export EMAIL="$author <$aut...@$hostname>"
+	fi
 	if [ -n "$message" ]; then
 		bzr commit $BZR_COMMIT_OPTIONS -m "$message"
 	else

Reply via email to