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

Re: [PATCH 2/2] give exclude mechanism a debug option

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2009, 21:45 UTC
Message-ID
<7viqnludiv.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090207114444.GB18079@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 16 quoted lines
> On Fri, Feb 06, 2009 at 11:38:38PM -0800, Junio C Hamano wrote:
>
>> >   2. If you ask for "foo/bar", and "foo/" is ignored, the
>> >      output will show only "foo: exclude: foo". This is an
>> >      artifact of the calling interface: you don't ask "is
>> >      foo/bar excluded", but rather while recursing through
>> >      "foo/" you ask "should I bother even recursing into
>> >      foo?". So the exclusion code never even knows that you
>> >      might have cared about foo/bar in the first place.
>> 
>> I do not see why it is a problem.  It exactly is what you want to know,
>> isn't it?
>
> Because I would expect "git check-ignore foo/bar | grep ^foo/bar:" to
> tell me if and how foo/bar is being excluded. But I have to instead
> check for ^foo and ^foo/bar.

Sorry, I do not understand why you need the downstream pipe that filters using grep to begin with.

Shouldn't "git check-ignore dir/path" talk about the exclude entries that caused dir/path to be excluded and no other patterns? And if the reason dir/path is exclude is because there was a higher level entry to exclude dir/, the output would say so. If there are unrelated exclude entries that exclude dir's neighbour dir2 or dir/path's neighbour dir/path2, they do not affect if dir/path is excluded, so check-ignore wouldn't show, no?

Previous: Jeff KingNext: Jeff King
Message 11 of 17 in “How to find out which gitignore blocks my git-add”
  1. GonzoFeb 6, 2009
  2. Jeff KingFeb 6, 2009
  3. Sitaram ChamartyFeb 7, 2009
  4. Jeff KingFeb 7, 2009
  5. 1/2 refactor exclude handlingJeff King, Feb 7, 2009
  6. 2/2 give exclude mechanism a debug optionJeff King, Feb 7, 2009
  7. Junio C HamanoFeb 7, 2009
  8. Junio C HamanoFeb 7, 2009
  9. Jeff KingFeb 7, 2009
  10. Jeff KingFeb 7, 2009
  11. Junio C HamanoFeb 7, 2009
  12. Jeff KingFeb 8, 2009
  13. Junio C HamanoFeb 8, 2009
  14. Jeff KingFeb 8, 2009
  15. Sitaram ChamartyFeb 7, 2009
  16. Jeff KingFeb 7, 2009
  17. bisaniFeb 6, 2009

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.