summaryrefslogtreecommitdiff
path: root/commit.d
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-07-19 20:06:59 +0200
committerJoey Hess <joey@gnu.kitenet.net>2009-07-19 20:06:59 +0200
commitcde31f34d6f8a8f961d69decb7660268c697b25b (patch)
tree80456b45c83b21c1096b3e0af5d2a7da69c0133b /commit.d
parent4d8fc066c3465e8d02adb6662cf621ba6b6804d5 (diff)
bzr: Set author to root when committing via sudo. Committer will be the sudo user, as it is in git.
Diffstat (limited to 'commit.d')
-rwxr-xr-xcommit.d/50vcs-commit5
1 files changed, 3 insertions, 2 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit
index 687a2ed..e7e0eaf 100755
--- a/commit.d/50vcs-commit
+++ b/commit.d/50vcs-commit
@@ -26,11 +26,12 @@ elif [ "$VCS" = hg ] && [ -d .hg ]; then
elif [ "$VCS" = bzr ] && [ -d .bzr ]; then
if [ -n "$SUDO_USER" ]; then
export EMAIL="$SUDO_USER <$SUDO_USER@$hostname>"
+ BZR_AUTHOR='--author="root <root@$hostname>"'
fi
if [ -n "$message" ]; then
- bzr commit $BZR_COMMIT_OPTIONS -m "$message"
+ bzr commit "$BZR_AUTHOR" $BZR_COMMIT_OPTIONS -m "$message"
else
- bzr commit $BZR_COMMIT_OPTIONS
+ bzr commit "$BZR_AUTHOR" $BZR_COMMIT_OPTIONS
fi
elif [ "$VCS" = darcs ] && [ -d _darcs ]; then
logfile="$( mktemp -t etckeeper-$VCS.XXXXXXXXXX )"