git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gitignore, re-inclusion fix
@ 2015-08-23 12:50 Nguyễn Thái Ngọc Duy
  2015-08-23 12:50 ` [PATCH 1/2] dir.c: make last_exclude_matching_from_list() run til the end Nguyễn Thái Ngọc Duy
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2015-08-23 12:50 UTC (permalink / raw)
  To: git; +Cc: Eric Sunshine, Junio C Hamano,
	Nguyễn Thái Ngọc Duy

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-09-17 13:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 12:50 [PATCH 0/2] gitignore, re-inclusion fix Nguyễn Thái Ngọc Duy
2015-08-23 12:50 ` [PATCH 1/2] dir.c: make last_exclude_matching_from_list() run til the end Nguyễn Thái Ngọc Duy
2015-08-25 20:28   ` Junio C Hamano
2015-08-31 10:13     ` Duy Nguyen
2015-08-23 12:50 ` [PATCH 2/2] dir.c: don't exclude whole dir prematurely if neg pattern may match Nguyễn Thái Ngọc Duy
2015-09-13  1:18 ` [PATCH v2 0/2] gitignore, re-inclusion fix Nguyễn Thái Ngọc Duy
2015-09-13  1:19   ` [PATCH v2 1/2] dir.c: make last_exclude_matching_from_list() run til the end Nguyễn Thái Ngọc Duy
2015-09-13  1:19   ` [PATCH v2 2/2] dir.c: don't exclude whole dir prematurely if neg pattern may match Nguyễn Thái Ngọc Duy
2015-09-14 17:15     ` Junio C Hamano
2015-09-17 13:21       ` Duy Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).