#549354 etckeeper: don't warn about ignored files

#549354#5
Date:
2009-10-02 17:53:21 UTC
From:
To:
Every time etckeeper runs, it warns me about the same couple of files:

etckeeper warning: special files could cause problems with bzr:
./service/vbox-TinyXP/supervise/ok
./service/vbox-TinyXP/supervise/control

But I've already told bzr to ignore these files, so there is in fact
no problem.  It would be nice if 20warn-hardlinks and
20warn-special-file in /etc/etckeeper/pre-commit.d removed ignored
files from the list before warning me.

The attached patches for 20warn-special-file and 20warn-hardlinks,
together with the file /usr/share/etckeeper/functions.sh, do this, but
only for bzr so far.  To extend this to other VCSes, all that would be
needed is to add clauses for them to the 'if' statement in
filter_ignored(), with commands that output a newline-delimited list
of ignored files.

As things stand here, filter_ignored() is called twice, and it calls
the VCS to output the list of ignored files each time it's called.  So
this solution could be slow.  Obvious improvements would be to have
filter_ignored() exit immediately if it detects that there are no file
names on stdin, or else call out for the list of ignored files only
once, in /usr/sbin/etckeeper, and store the result in an environment
variable.

Thanks,
Andrew.

#549354#10
Date:
2009-10-02 23:13:08 UTC
From:
To:
Hm... well, nevermind about the patches.  They work when I just run
'etckeeper pre-commit', but not when I try to commit with bzr.  bzr
complains that it can't get a lock, apparently because it's already running
and then I try to run it again to get the ignored list.

So I guess the right place to get the 'ignored' list would be in the bzr
etckeeper plugin.  I don't know much about how to do that but may give it a
try.

Thanks,
Andrew.

#549354#15
Date:
2010-10-12 03:15:37 UTC
From:
To:
Hello,

This issue was annoying me, so I hunted down this bug and tried some
variations. I found a fix with git ls-files, and the diff is here:

http://www.docunext.com/wiki/Etckeeper

Thanks for another awesome piece of software, Joey!

Albert

#549354#20
Date:
2010-10-12 06:36:29 UTC
From:
To:
Albert Lash wrote:

        special=$(find . -not -type d -not -type f -not -type l -exec git ls-files {} \; | grep -v '/\.git/') || true

I think it probably needs to use git ls-files --exclude-standard --cached --others
That way, committed and uncommitted files will be listed, and ignored
files won't be.

#549354#25
Date:
2014-11-08 23:14:54 UTC
From:
To:
Albert's patch has moved to http://www.docunext.com/wiki/etckeeper.html

It is also attached here.

Francois