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

Re: [PATCH] libify git-ls-files directory traversal

From
Linus Torvalds <torvalds@osdl.org>
Date
May 17, 2006, 02:36 UTC
Message-ID
<Pine.LNX.4.64.0605161931340.10823@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0605161859050.16475@g5.osdl.org>
On Tue, 16 May 2006, Linus Torvalds wrote:
> 
> NOTE! Not all of git-ls-files is libified by this.  The index matching
> and pathspec prefix calculation is still in ls-files.c, but this is a
> big part of it.

Side note: the reason I held off on the index matching is that git-ls-files currently uses a pretty disgusting trick to make the index accesses faster for the common subdirectory case, namely it basically rewrites the index so that it only contains the entries defined by a common prefix.

Now, that's fine for git-ls-files, but it's not fine for a library function where the caller may well want to actually use the index that it has read in (eg "git add" and "git commit" both want to work with the full index).

So libification of that part will require more than splitting things into a new file and passing in a structure pointer that contains the data for the function.

That said, a lot of the current shell scripts seem to use mainly "git-ls-files" with the "--others" flag, and in that case the current libification should be already sufficient.

		Linus
Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 4 in “libify git-ls-files directory traversal”
  1. libify git-ls-files directory traversalLinus Torvalds, May 17, 2006
  2. Linus TorvaldsMay 17, 2006
  3. Clean up git-ls-file directory walking library interfaceLinus Torvalds, May 17, 2006
  4. Linus TorvaldsMay 17, 2006

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.