From e5742f7ae353f9a675e13fc0b951daeeff82bdae Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Dec 2012 17:07:35 +0100 Subject: Auto-detect the VCS setting if there already is a repository in /etc. --- debian/changelog | 5 +++++ etckeeper | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9ea9a3e..6347a70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ etckeeper (0.65) UNRELEASED; urgency=low + [ Joey Hess ] * Unset GIT_DIR and GIT_WORK_TREE. Closes: #689101 * PUSH_REMOTE can be set to automatically push to a remote on commit. Thanks, L. Alberto Giménez + [ Jelmer Vernooij ] + * Auto-detect the VCS setting if there already is a repository in + /etc. + -- Joey Hess Sat, 29 Sep 2012 10:46:21 -0400 etckeeper (0.64) unstable; urgency=low diff --git a/etckeeper b/etckeeper index fad1f20..bbdecff 100755 --- a/etckeeper +++ b/etckeeper @@ -16,6 +16,16 @@ if [ -e $conf ]; then . $conf fi +if [ -d ".git" ]; then + VCS=git +elif [ -d ".hg" ]; then + VCS=hg +elif [ -d "_darcs" ]; then + VCS=darcs +elif [ -d ".bzr" ]; then + VCS=bzr +fi + if [ -z "$VCS" ]; then echo "Please configure a VCS in $conf" >&2 exit 1 -- cgit v1.2.3