From 7f95ccf12aa02db60f560a66fc43d8bae1e1175c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 4 Jan 2008 18:34:54 -0500 Subject: tricky stuff to do with storing metadata etc in pre-commit git needs to git add the files to stage them as part of the current commit, but hg does not, and hg add doesn't do that. Create the files as part of init, this will cause them to be added, pre-commit, which hg needs. --- pre-commit.d/20store-empty-directory | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pre-commit.d/20store-empty-directory') diff --git a/pre-commit.d/20store-empty-directory b/pre-commit.d/20store-empty-directory index 0cab9df..a52a383 100755 --- a/pre-commit.d/20store-empty-directory +++ b/pre-commit.d/20store-empty-directory @@ -16,11 +16,12 @@ if [ "$VCS" = git ] || [ "$VCS" = hg ]; then if [ ! -e .etckeeper ] || ! cmp -s .etckeeper .etckeeper.new ; then mv -f .etckeeper.new .etckeeper + # stage the file as part of the current commit if [ "$VCS" = git ]; then git add .etckeeper - elif [ "$VCS" = hg ]; then - hg add .etckeeper fi + # hg add not done, hg will automatically include the file + # in the current commit else rm -f .etckeeper.new fi -- cgit v1.2.3