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 /init.d/50vcs-pre-commit-hook | |
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
Diffstat (limited to 'init.d/50vcs-pre-commit-hook')
-rwxr-xr-x | init.d/50vcs-pre-commit-hook | 6 |
1 files changed, 3 insertions, 3 deletions
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 ;; |