> But the patch there doesn't apply to the Debian > /etc/etckeeper/pre-commit.d/20warn-problem-files
But the following reworked version of the patch does apply. It has fixed the problem for me.
--- etc/etckeeper/pre-commit.d/20warn-problem-files 2016-07-18 01:01:39.000000000 +0200 +++ etc/etckeeper/pre-commit.d/20warn-problem-files 2017-08-12 10:36:13.360410731 +0200 @@ -1,19 +1,20 @@ #!/bin/sh set -e -exclude_internal () { - egrep -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/' -} +# (Note that when using this, the find expression must end with +# -print or -exec, else the excluded directories will actually be +# printed!) +NOVCS='. -path ./.git -prune -o -path ./.bzr -prune -o -path ./.hg -prune -o -path ./_darcs -prune -o' if [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then - special=$(find . ! -type d ! -type f ! -type l | exclude_internal) || true - hardlinks=$(find . -type f ! -links 1 | exclude_internal ) || true + special=$(find $NOVCS ! -type d ! -type f ! -type l -print) || true + hardlinks=$(find $NOVCS -type f ! -links 1 -print) || true elif [ "$VCS" = hg ]; then - special=$(find . ! -type d ! -type f ! -type l | exclude_internal) || true - hardlinks=$(find . -type f ! -links 1 -exec hg status {} \; | exclude_internal ) || true + special=$(find $NOVCS ! -type d ! -type f ! -type l -print) || true + hardlinks=$(find $NOVCS -type f ! -links 1 -exec hg status {} \; -print) || true elif [ "$VCS" = git ]; then - special=$(find . ! -type d ! -type f ! -type l -exec git ls-files --exclude-standard --cached --others {} + | exclude_internal) || true - hardlinks=$(find . -type f ! -links 1 -exec git ls-files --exclude-standard --cached --others {} + | exclude_internal) || true + special=$(find $NOVCS ! -type d ! -type f ! -type l -exec git ls-files --exclude-standard --cached --others {} + -print) || true + hardlinks=$(find $NOVCS -type f ! -links 1 -exec git ls-files --exclude-standard --cached --others {} + -print) || true else special="" fi