diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | etckeeper | 8 | ||||
-rw-r--r-- | etckeeper.conf | 5 | ||||
-rwxr-xr-x | post-apt.d/50git-commit | 2 | ||||
-rwxr-xr-x | pre-apt.d/50uncommitted-changes | 2 |
5 files changed, 16 insertions, 2 deletions
@@ -1,6 +1,7 @@ install: mkdir -p $(PREFIX)/etc/etckeeper/ cp -a *.d $(PREFIX)/etc/etckeeper/ + cp etckeeper.conf $(PREFIX)/etc/etckeeper/ install -D etckeeper $(PREFIX)/usr/bin/etckeeper install -m 0644 -D apt.conf $(PREFIX)/etc/apt/apt.conf.d/05etckeeper install -m 0644 -D etckeeper.1 $(PREFIX)/usr/share/man/man1/etckeeper.1 @@ -1,6 +1,14 @@ #!/bin/sh set -e +if [ -e /etc/etckeeper/etckeeper.conf ]; then + . /etc/etckeeper/etckeeper.conf +fi + +if [ ! -z "$GIT_COMMIT_OPTION" ]; then + export GIT_COMMIT_OPTION +fi + if [ -z "$1" ]; then echo "usage: etckeeper command [directory]" >&2 exit 1 diff --git a/etckeeper.conf b/etckeeper.conf new file mode 100644 index 0000000..6941e10 --- /dev/null +++ b/etckeeper.conf @@ -0,0 +1,5 @@ +# GIT_COMMIT_OPTION : option given to git commit when run by etckeeper +# you could for exemple use GIT_COMMIT_OPTION="-e" if you want to edit +# all commit message before commiting + +# GIT_COMMIT_OPTION="" diff --git a/post-apt.d/50git-commit b/post-apt.d/50git-commit index 6eb3434..fe5eb95 100755 --- a/post-apt.d/50git-commit +++ b/post-apt.d/50git-commit @@ -8,5 +8,5 @@ if [ -d .git ]; then message="committing changes after apt run" # ignore exit code since it exits nonzero if there is nothing to do - git commit -m "$message" || true + git commit $GIT_COMMIT_OPTION -m "$message" || true fi diff --git a/pre-apt.d/50uncommitted-changes b/pre-apt.d/50uncommitted-changes index dd8db13..eb3a64d 100755 --- a/pre-apt.d/50uncommitted-changes +++ b/pre-apt.d/50uncommitted-changes @@ -12,7 +12,7 @@ if [ -d .git ] && ! LANG=C git-status 2>&1 | grep -q "working directory clean"; db_get etckeeper/unclean if [ "$RET" = true ]; then git add . - if ! git commit -m "saving uncommitted changes in /etc prior to apt run"; then + if ! git commit $GIT_COMMIT_OPTION -m "saving uncommitted changes in /etc prior to apt run"; then db_input critical etckeeper/commit_failed || true db_go || true db_reset etckeeper/commit_failed || true |