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

Re: git-add has gone lstat() mad

From
Junio C Hamano <junkio@cox.net>
Date
Apr 1, 2007, 00:39 UTC
Message-ID
<7vy7ld3p33.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0703302020510.6730@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> Here's a patch. It passes all tests. It's not that complex. But people 
> should double-check. ESPECIALLY the list of special characters (currently 
> '?' '*' '\\' and '[').
I think the above is a good set.

This is an optimization different from what I was thinking about. I was hoping that we do not even need to call into read_directory() if all the pathspec[] elements succeeds to lstat() and they are not directories; in such a case we can just stuff them to dir structure by hand, and use the remainder for directory walk.

But I like this patch better. We need to look at .gitignore to warn about adding ignored files, so we cannot just stuff what are found to dir without checking if they are ignored.

Previous: Tom PrinceNext: Andy Parkins
Message 9 of 10 in “git-add has gone lstat() mad”
  1. Andy ParkinsMar 30, 2007
  2. Andy ParkinsMar 30, 2007
  3. Junio C HamanoMar 31, 2007
  4. Linus TorvaldsMar 31, 2007
  5. Andy ParkinsMar 31, 2007
  6. Randal L. SchwartzMar 31, 2007
  7. Andy ParkinsMar 31, 2007
  8. Tom PrinceMar 31, 2007
  9. Junio C HamanoApr 1, 2007
  10. Andy ParkinsApr 1, 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.