diff options
author | Joey Hess <joey@kitenet.net> | 2011-04-09 13:41:43 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-04-09 13:41:43 -0400 |
commit | 13f115d6b706a715e964e5b7012c01b6a36a5125 (patch) | |
tree | 4a9ce5963c7e789771dcb6774e2592a4aafb90be | |
parent | c1503fb14979594c7906f2b1ccc117c1d8c73a77 (diff) |
Use hg pre-commit hook, rather than its precommit hook, as the latter is run after the files staged for commit are determined and so .etckeeper cannot be staged as part of the current commit. Closes: #621827
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | init.d/50vcs-pre-commit-hook | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index a90bd61..fb7bd85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ etckeeper (0.54) UNRELEASED; urgency=low * Ignore inssev's FHS violating /etc/init.d/.depend.* files. Closes: #619407 See #619409 + * Use hg pre-commit hook, rather than its precommit hook, + as the latter is run after the files staged for commit are + determined and so .etckeeper cannot be staged as part of the current + commit. Closes: #621827 -- Joey Hess <joeyh@debian.org> Fri, 25 Mar 2011 15:14:32 -0400 diff --git a/init.d/50vcs-pre-commit-hook b/init.d/50vcs-pre-commit-hook index e1745b1..6045981 100755 --- a/init.d/50vcs-pre-commit-hook +++ b/init.d/50vcs-pre-commit-hook @@ -19,15 +19,15 @@ EOF ;; hg) if [ -e .hg/hgrc ] && grep "^\[hooks\]" .hg/hgrc; then - if ! grep -q "etckeeper pre-commit" .hg/hgrc; then - echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to run: etckeeper pre-commit -d `pwd`" >&2 + if ! grep "^pre-commit" .hg/hgrc | grep -q "etckeeper pre-commit"; then + echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to contain: pre-commit = etckeeper pre-commit -d `pwd`" >&2 fi else touch .hg/hgrc cat >>.hg/hgrc <<EOF [hooks] # pre-commit hook for etckeeper, to store metadata and do sanity checks -precommit = etckeeper pre-commit -d `pwd` +pre-commit = etckeeper pre-commit -d `pwd` EOF fi ;; |