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

Re: inotify daemon speedup for git [POC/HACK]

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jul 27, 2010, 23:29 UTC
Message-ID
<AANLkTinuU6b1vmRFuBrA4Tc5H6gmC5cMP3Pa8EYz-8JE@mail.gmail.com>
In-Reply-To
<20100727122018.GA26780@pvv.org>
On Tue, Jul 27, 2010 at 8:20 AM, Finn Arne Gangstad <finnag@pvv.org> wrote:
Show 9 quoted lines
> Reading through the thread about subtree I noticed Avery mentioning
> using inotify to speed up git status & co.
>
> Here is a quick hack I did some time ago to test this out, to use it
> call "igit" instead of "git" for all commmands you want to speed up.
>
> There is one minor nit: The speedup gain is zero :) git still
> traverses all directories to look for .gitignore files, which seems to
> totally kill the optimisation.
Hey, this is kind of cool.  Except for that last part :)

Actually I think the problem is a little worse than .gitignore files. 'git status', for example (which is called by git commit), wants to generate a list of the files it *doesn't* know about. Unfortunately, those files aren't in the index at all. So it resorts to doing recursive readdir() across the entire repository. The net result is about as slow as doing that plus one stat() per file in the index.

An inotify daemon could easily keep track of which files have been added that aren't in the index... but where would it put the list of files git doesn't know about? Do they go in the index with a special NOT_REALLY_INDEXED flag?

This is the main question that has so far prevented me from trying to solve the problem myself.

Thanks,
Avery
Previous: Finn Arne GangstadNext: Joshua Juran
Message 2 of 18 in “inotify daemon speedup for git [POC/HACK]”
  1. Finn Arne GangstadJul 27, 2010
  2. Avery PennarunJul 27, 2010
  3. Joshua JuranJul 27, 2010
  4. Avery PennarunJul 27, 2010
  5. Shawn O. PearceJul 28, 2010
  6. Avery PennarunJul 28, 2010
  7. Joshua JuranJul 28, 2010
  8. Avery PennarunJul 28, 2010
  9. Sverre RabbelierJul 28, 2010
  10. Jonathan NiederJul 28, 2010
  11. Ævar Arnfjörð BjarmasonJul 28, 2010
  12. Theodore TsoJul 28, 2010
  13. Nguyen Thai Ngoc DuyJul 28, 2010
  14. Enrico WeigeltAug 13, 2010
  15. Jakub NarebskiJul 28, 2010
  16. Jakub NarebskiJul 28, 2010
  17. Enrico WeigeltAug 13, 2010
  18. Sverre RabbelierJul 27, 2010

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.