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
Mar 31, 2007, 01:38 UTC
Message-ID
<7vslbmxkcv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200703302120.23713.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
> I can't see why git feels that it has to recurse the entire subtree.  It 
> seems to be something to do with the gitignore stuff.  Surely there is 
> no need to use a recursive search when no directories are being added?
I do not think this is anything new.
Show 5 quoted lines
> If git-add were given
>
>  file1
>  dir1/file2
>  dir2/dir3/file3

The thing is, you are not giving the above three pathnames, although you might think you are.

You are giving three path *patterns* and asking git-add: "please run 'git ls-files --others' and add the ones that match these patterns".

You can teach it to detect cases where you do not have wildcard (that is both shell glob wildcard and directory names; the latter means "grab everything in that named directory") to limit the set of directories to descend into.

Patches are welcome, but applying them to 'master' needs to wait post 1.5.1.

Previous: Andy ParkinsNext: Linus Torvalds
Message 3 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.