git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] test overlapping ignore patterns

From
Stephen Haberman <stephen@exigencecorp.com>
Date
Jul 7, 2011, 18:12 UTC
Message-ID
<1310062372893-6559395.post@n2.nabble.com>
In-Reply-To
<1229620278-25152-1-git-send-email-git@drmicha.warpmail.net>
> Add a test which checks that negated patterns such as "!foo.html" can 
> override previous patterns such as "*.html". This is documented 
> behaviour but had not been tested so far. 

Negated excludes with a pattern does not seem to work with sub directories, e.g. the following test fails for me.

The file /one/two/a.1 exists, and is initially excluded by *, but not re-included by "!*.1" (where as /a.1 is re-included).

diff --git i/t/t3001-ls-files-others-exclude.sh
w/t/t3001-ls-files-others-exclude.sh
index c8fe978..e6c86ff 100755
--- i/t/t3001-ls-files-others-exclude.sh
+++ w/t/t3001-ls-files-others-exclude.sh
@@ -175,6 +175,12 @@ test_expect_success 'negated exclude matches can
override previous ones' '
  grep "^a.1" output
 '
 
+test_expect_success 'negated exclude matches can override previous ones 2'
'
+
+ git ls-files --others --exclude="*" --exclude="!*.1" >output &&
+ grep "^one/two/a.1" output
+'
+

(Replying to this old thread via nabble; hopefully it works.)

- Stephen


--
View this message in context: http://git.661346.n2.nabble.com/git-ignore-tp1665336p6559395.html
Sent from the git mailing list archive at Nabble.com.
Previous: Michael J GruberNext: Junio C Hamano
Message 5 of 7 in “git ignore”
  1. Max PowerDec 16, 2008
  2. Linus TorvaldsDec 16, 2008
  3. Junio C HamanoDec 16, 2008
  4. test overlapping ignore patternsMichael J Gruber, Dec 18, 2008
  5. Stephen HabermanJul 7, 2011
  6. Junio C HamanoJul 8, 2011
  7. Stephen HabermanJul 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.