[PATCH 0/2] gitignore, re-inclusion fix
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Aug 23, 2015, 12:50 UTC
- Message-ID
- <1440334214-32131-1-git-send-email-pclouds@gmail.com>
This is an old problem. I attempted once [1] and then was reminded [2] with some more comments on the original patch. Let's try again.
The problem is this .gitignore currently does not work, but it should:
/abc !/abc/def/ghi
This patch fixes that by realizing that the last rule may re-include something in abc/def so it does not exclude "abc" and "abc/def" outright to give the last rule a chance to match.
[1] http://article.gmane.org/gmane.comp.version-control.git/259870 [2] http://thread.gmane.org/gmane.comp.version-control.git/265901/focus=266227
Nguyễn Thái Ngọc Duy (2): dir.c: make last_exclude_matching_from_list() run til the end dir.c: don't exclude whole dir prematurely if neg pattern may match
Documentation/gitignore.txt | 21 ++++++--- dir.c | 89 +++++++++++++++++++++++++++++++++++--- t/t3001-ls-files-others-exclude.sh | 20 +++++++++ 3 files changed, 118 insertions(+), 12 deletions(-)
-- 2.3.0.rc1.137.g477eb31