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

Re: [PATCH 3/3] builtin-add: simplify (and increase accuracy of) exclude handling

From
Jeff King <peff@peff.net>
Date
Jun 11, 2007, 15:54 UTC
Message-ID
<20070611155425.GA9316@coredump.intra.peff.net>
In-Reply-To
<20070611150122.GA11020@diku.dk>
On Mon, Jun 11, 2007 at 05:01:23PM +0200, Jonas Fonseca wrote:
> Thanks for looking into this and making these patches. :)

No problem. I had run it across it before and it was on my "look into this" list...thank you for providing a test case. :)

> I think you could even get rid of has_ignored with something like this.

Nope, I had originally wanted to do that, but the dir_struct.ignored list contains _all_ ignored items, not just those that were originally in the pathspec. The prune_ignored call sets uninteresting ones to NULL. That function could compact the list and re-set ignored_nr, but it doesn't currently do so.

An even more elegant solution would be for read_directory to mark whether an ignored file comes from a pathspec, or was found through recursion. That would be more efficient, and it would remove the prune_ignored thing, which is IMHO a little hack-ish.

I don't have time to work on it now, but I might look at it more tonight or tomorrow (but please, if you are interested, take a crack at it).

-Peff
Previous: Jonas FonsecaNext: Jonas Fonseca
Message 13 of 16 in “Adding empty directory gives bogus error message”
  1. Jonas FonsecaJun 10, 2007
  2. Jeff KingJun 11, 2007
  3. 1/3 refactor dir_add_nameJeff King, Jun 11, 2007
  4. Johannes SchindelinJun 11, 2007
  5. Junio C HamanoJun 11, 2007
  6. Jeff KingJun 11, 2007
  7. Junio C HamanoJun 12, 2007
  8. Jeff KingJun 12, 2007
  9. Jonas FonsecaJun 12, 2007
  10. 2/3 dir_struct: add collect_ignored optionJeff King, Jun 11, 2007
  11. 3/3 builtin-add: simplify (and increase accuracy of) exclude handlingJeff King, Jun 11, 2007
  12. Jonas FonsecaJun 11, 2007
  13. Jeff KingJun 11, 2007
  14. Jonas FonsecaJun 11, 2007
  15. Jeff KingJun 11, 2007
  16. Jonas FonsecaJun 12, 2007

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.