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

Re: Mercurial's only true "plugin" extension: inotify... and can it be done in Git?

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 10, 2008, 22:43 UTC
Message-ID
<20080310224318.GC8410@spearce.org>
In-Reply-To
<3838F28A-DB0C-4678-BA57-3344E2225889@adacore.com>
Geert Bosch <bosch@adacore.com> wrote:
Show 11 quoted lines
> On Mar 9, 2008, at 09:59, Jakub Narebski wrote:
> 
> >This extension[3][4] optimises "hg status" command by asking file
> >notification daemon about changed files instead of doing stat. I'm not
> >sure how useful this extension is: inotify is Linux specific, and  
> >Linux
> >has fast stat... nevertheless this is one example where extension
> >(plug-in) framework shows that it can do more than good scriptability.
> 
> FWIW, OS X 10.5 has a similar functionality, called "fsevents",
> as well as a much slower stat.

Windows NT on NTFS has a file monitor system that works somewhat like an inotify, but different enough that you gotta write totally different code for it. It also has a much slower stat.

I have wanted to put something like this into git-gui, so that a running git-gui session can see changes made to your working dir "live". But I haven't gotten around to writing it. I did do some early experiments on Windows NT + NTFS with a small C daemon that watches the working directory, but it ran into issues about also need to know what is inside .gitignore to properly avoid sending events that git-gui doesn't want to know about. Like say build object files. :-)

I think the reason Git has never had such an "extension" is we are just that freaking fast when it comes to comparing the working tree to the index. hg wasn't in the early days and that may have been what gave rise to the plugin.

-- 
Shawn.
Previous: Geert BoschNext: J. Bruce Fields
Message 8 of 10 in “Mercurial's only true "plugin" extension: inotify... and can it be done in Git?”
  1. Jakub NarebskiMar 9, 2008
  2. Jakub NarebskiMar 10, 2008
  3. Andreas EricssonMar 11, 2008
  4. Junio C HamanoMar 11, 2008
  5. Andreas EricssonMar 11, 2008
  6. Jakub NarebskiMar 11, 2008
  7. Geert BoschMar 10, 2008
  8. Shawn O. PearceMar 10, 2008
  9. J. Bruce FieldsMar 10, 2008
  10. Jakub NarebskiMar 15, 2008

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.