From 65eda73020e0aa6bf15e64106dae955bf17a41dd Mon Sep 17 00:00:00 2001 From: Stefan Tomanek Date: Thu, 15 Jul 2010 22:34:10 +0200 Subject: [PATCH] add "vcs" to pass commands to the vcs program 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. --- vcs.d/30vcs-cmd | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 vcs.d/30vcs-cmd diff --git a/vcs.d/30vcs-cmd b/vcs.d/30vcs-cmd new file mode 100755 index 0000000..074523d --- /dev/null +++ b/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