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

Re: [GSoC] Designing a faster index format - Progress report

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
May 29, 2012, 13:43 UTC
Message-ID
<CACsJy8C1j6MT9ho2TRUKBG0bpB+hg8rhiAE4QEsf-_X-55c59A@mail.gmail.com>
In-Reply-To
<87vcjfi09m.fsf@thomas.inf.ethz.ch>
On Tue, May 29, 2012 at 8:29 PM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 19 quoted lines
> I envision an index API that more strictly controls access to the index.
> Right now the API consists largely of read_index, write_index and the
> flat the_index->cache array of entries.  Eventually it will have to be a
> family of calls that support the v5 format, and boil down to suitable
> wrappers for older ones.  For example (just tossing up ideas):
>
>  index_open(struct index_state *index, int fd):
>    initialization, checking, leaves the "real" data fields empty
>
>  index_load_filtered(..., const char **pathspec):
>    load everything needed to satisfy queries filtered by 'pathspec'
>
>  index_for_each_entry(..., void (*callback)(struct cache_entry *ent)):
>    like the current hand-rolled looping
>
>  index_for_each_entry_filtered(..., void (*callback)(struct cache_entry *ent), char **pathspec):
>    ditto but for a pathspec lookup
>
> etc.

I'm towards readdir interface with filter flags (e.g. staged entries only, unmerged only, all...) for serial access and something like stat() for one-file check. That may be enough for ls-files conversion. With readdir-like interface where entries are sorted, I can help add pathspec support to tree_entry_interesting(). This function can be used by new ls-files to filter pathspec instead of the list-based pathspec_matches().

One thing to consider is, will this new API work with old versions too (i.e. can conversion be hidden behind the scene without significant performance loss)? If it does, great we only have to maintain one API, the future is bright. Otherwise, I don't know..

> Actually converting the rest of the git code base to such an API is too
> big an undertaking for the summer, so please don't stray on that path.
Agreed.
-- 
Duy
Previous: Thomas RastNext: Junio C Hamano
Message 12 of 13 in “[GSoC] Designing a faster index format - Progress report”
  1. Thomas GummererMay 23, 2012
  2. Thomas RastMay 24, 2012
  3. Junio C HamanoMay 24, 2012
  4. Nguyen Thai Ngoc DuyMay 25, 2012
  5. Thomas GummererMay 25, 2012
  6. Nguyen Thai Ngoc DuyMay 26, 2012
  7. Thomas GummererMay 27, 2012
  8. Junio C HamanoMay 27, 2012
  9. Nguyen Thai Ngoc DuyMay 27, 2012
  10. Thomas GummererMay 28, 2012
  11. Thomas RastMay 29, 2012
  12. Nguyen Thai Ngoc DuyMay 29, 2012
  13. Junio C HamanoMay 29, 2012

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.