Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using git with etckeeper.

When I use sudo git to commit changes in /etc/, GIT_AUTHOR_NAME & GIT_AUTHOR_EMAIL from my env are used (as intended).

When I use sudo apt-get and changes are auto-commited, the local username@host is used instead.

Why the change in behavior and how can I make sudo apt-get use the ENV vars?

share|improve this question
add comment

1 Answer 1

Looks like this is fixed in etckeeper 1.5 :)

It was happening in /etc/etckeeper/commit.d/50vcs-commit

if [ "$VCS" = git ] && [ -d .git ]; then
  if [ -n "$USER" ]; then
    export GIT_AUTHOR_NAME="$USER"
    export GIT_AUTHOR_EMAIL="$USER@$hostname"
  fi
  if [ -n "$logfile" ]; then
    git commit $GIT_COMMIT_OPTIONS -F "$logfile"
  else
    git commit $GIT_COMMIT_OPTIONS
  fi
[ ... ]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.