Skip to content

Commit

Permalink
add "vcs" to pass commands to the vcs program
Browse files Browse the repository at this point in the history
This new command allows the user to execute arbitrary commands inside the
environment etckeeper runs in. This ensures that variables like $HOME match
the values present during the commit process.

Using the command "etckeeper vcs config user.email" will use the same git
configuration as "etckeeper commit", while the value used by "git config"
might vary due to the use of "sudo" and its handling of $HOME.
  • Loading branch information
wertarbyte committed Jul 15, 2010
1 parent 005248d commit 65eda73
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions vcs.d/30vcs-cmd
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

IFS='
'

# check whether we can locate the vcs binary
if [ -n "$VCS" ] && which "$VCS" > /dev/null; then
# pass commands to the VCS application
$VCS $@
fi

0 comments on commit 65eda73

Please sign in to comment.