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 8, 2011, 18:39 UTC
Message-ID
<20110708133930.04b04a49@sh9>
In-Reply-To
<7vk4bsfy8c.fsf@alter.siamese.dyndns.org>
> Doesn't the first "*" tells us to not to look at the contents of one/
> directory at all, so we that we do not have to waste time descending
> into it?  We wouldn't even know what pathnames are underneath it, so
> "!*.1" would not have any effect inside one/ at all, I think.
If that's the way the feature should work, that's fine.

I came across this thread via google referencing Linus's post from 2008 which mentioned versioning only jpg files. I want to do the same sort of thing, but with a directory hierarchy.

If I say "exclude *.jpg" in my root .gitignore file, that applies into sub directories, so I just assumed "exclude !*.jpg" would also apply to sub directories.

Am I missing another way to accomplish this?

I understand from an implementation perspective, skipping all subdirectories when you see "exlude *" is a smart thing to do, but perhaps it should only be done if there are no negative excludes that could bring items back into play?

Thanks, Stephen

Previous: Junio C Hamano
Message 7 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.