|
From: | Kirill Pushkaryov |
Subject: | Incorrect recursive behaviour of --exclude-ignore, --exclude-vcs-ignores |
Date: | Thu, 30 Jul 2020 13:15:12 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello! I've found that --exclude-ignore option and --exclude-vcs-ignores with .cvsignore act recursively, which contradicts the manual. A trivial patch is attached. The manual says (6.4):
By the way, a dot is missing in front of cvsignore in the second
line above. Nevertheless, both options currently (in the latest git revision
01dd89c) act recursively. How to reproduce for --exclude-ignore:
Current result:
Expected result: test/a/b must not be excluded. The same for --exclude-vcs-ignores:
Current result:
Expected result: test/a/b must not be excluded. I suspect a bug in info_attach_exclist() (exclist.c:116): ent = xmalloc (sizeof (*ent)); Here file is an exclusion file added by some options. The currently possible values of file->flags are as follows: a) EXCL_DEFAULT corresponds to --exclude-vcs-ignores option and marks standard VCS exclusion files. Such entries are created by exclude_vcs_ignores(); b) EXCL_RECURSIVE corresponds to --exclude-ignore-recursive; c) EXCL_NON_RECURSIVE corresponds to --exclude-ignore. Currently neither EXCL_RECURSIVE nor EXCL_NON_RECURSIVE are propagated from file->flags to ent->flags. Moreover, EXCL_NON_RECURSIVE flag in vcsfile->flags of .cvsignore entry is dropped too, because for .cvsignore file->flags == EXCL_DEFAULT. It looks like the condition in the code above is just erroneously inverted. I fixed this and the options started to work as expected. -- WBR, Kirill Pushkaryov. |
exclist.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |