{"thread":{"id":"12606","subject":"Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","startedAt":"2008-03-09T13:59:20Z","lastAt":"2008-03-15T11:22:13Z","messageCount":10,"participants":["Jakub Narebski","Geert Bosch","Shawn O. Pearce","J. Bruce Fields","Andreas Ericsson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"71517","messageId":"200803091459.21354.jnareb@gmail.com","threadId":"12606","inReplyTo":null,"subject":"Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-09T13:59:20Z","receivedAt":"2008-03-09T13:59:20Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"When reading \"Distributed Revision Control with Mercurial\"[1] to see\nhow Mercurial differs from Git, in the chapter 14 \"Adding functionality \nwith extensions\" there is description (in section 14.1) of one \ninteresting extension (see also [2]), namely 'inotify' extension. \n\nThis extension[3][4] optimises \"hg status\" command by asking file \nnotification daemon about changed files instead of doing stat. I'm not \nsure how useful this extension is: inotify is Linux specific, and Linux \nhas fast stat... nevertheless this is one example where extension \n(plug-in) framework shows that it can do more than good scriptability.\n\nI wonder if, and how, such 'extension' could be done with Git...\n\nReferences:\n===========\n[1] http://hgbook.red-bean.com\n[2] http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions\n[3] http://hgbook.red-bean.com/hgbookch14.html#x18-31700014.1\n[4] http://www.selenic.com/mercurial/wiki/index.cgi/InotifyExtension\n-- \nJakub Narebski\nPoland\n"},{"id":"71606","messageId":"200803101938.09300.jnareb@gmail.com","threadId":"12606","inReplyTo":"200803091459.21354.jnareb@gmail.com","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-10T18:38:08Z","receivedAt":"2008-03-10T18:38:08Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sun, 9 Mar 2008, Jakub Narebski wrote:\n\n> When reading \"Distributed Revision Control with Mercurial\" to\n> see how Mercurial differs from Git, in the chapter 14 \"Adding\n> functionality  with extensions\" there is description\n> (in section 14.1) of one  interesting extension,\n> namely 'inotify' extension. \n\nBy the way, when browsing list of available Mercurial extensions\nhttp://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions\ninotify extension was single extension which doesn't have less\nor more direct equivalent in Git, or cannot be easy done in Git.\n\nSee the table below for details:\n\nMercurial extension | git equivalent (or proposal)\n--------------------+------------------------------------\nacl                 | update-paranoid contrib hook\nalias               | alias.<cmd> config\nbisect              | git-bisect\nbugzilla            | possible as hook\nchildren            | possible command, cf. git-name-rev\nconvert (!)         | <possible, would be nice to have>\nextdiff             | diff.external / GIT_EXTERNAL_DIFF\nfetch               | git-pull (sic!)\ngpg                 | signed tags\ngraphlog            | <possible, see: tig, git-forest>\nhgk (*)             | gitk\nimerge              | see git-mergetool\nkeyword expansion   | check possible gitattributes\nmq                  | Guilt, StGit\nnotify              | post-receive-mail contrib hook,\n                    | default update hook\ngraphviz            | <can be done>\nsend                | <possible, wrapper around git-bundle>\nrdiff (!)           | <a trick for local repo in GitTips>\nlocalbranch (*)     | git-branch, git-checkout\nparentRevspec (*)   | rev^, rev^1 or rev^2, rev~n\npatchbomb           | git-send-email\nrecord              | git add -i, git commit -i\ntransplant          | git-rebase\nwin32ext            | core.autocrlf config\nchurn               | see git-shortlog\npurge               | git-clean\ncvscommit           | see git-cvsexportcommit, git-cvsserver\nconfig              | compare git-config\ndigest              | see git-ls-remote for bundle\ndiffstat            | git diff --diffstat, default for git-pull\neasy*               | see tig\nforest              | git-submodule\nhgcia               | CIA hook mentioned on GitWiki\ninotify (!!!)       |\n\nFootnotes:\n==========\n(*) Directly inspired by git feature\n(!) No direct equivalent, would be quite a work to add\n(!!!) No equivalent, don't know if possible\n\n-- \nJakub Narebski\nPoland\n"},{"id":"71609","messageId":"3838F28A-DB0C-4678-BA57-3344E2225889@adacore.com","threadId":"12606","inReplyTo":"200803091459.21354.jnareb@gmail.com","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Geert Bosch","fromEmail":"bosch@adacore.com","sentAt":"2008-03-10T19:22:03Z","receivedAt":"2008-03-10T19:22:03Z","isPatch":false,"sender":{"key":"bosch@adacore.com","avatar":null},"body":"\nOn Mar 9, 2008, at 09:59, Jakub Narebski wrote:\n\n> This extension[3][4] optimises \"hg status\" command by asking file\n> notification daemon about changed files instead of doing stat. I'm not\n> sure how useful this extension is: inotify is Linux specific, and  \n> Linux\n> has fast stat... nevertheless this is one example where extension\n> (plug-in) framework shows that it can do more than good scriptability.\n\nFWIW, OS X 10.5 has a similar functionality, called \"fsevents\",\nas well as a much slower stat.\n\n   -Geert\n"},{"id":"71620","messageId":"20080310224318.GC8410@spearce.org","threadId":"12606","inReplyTo":"3838F28A-DB0C-4678-BA57-3344E2225889@adacore.com","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-03-10T22:43:18Z","receivedAt":"2008-03-10T22:43:18Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Geert Bosch <bosch@adacore.com> wrote:\n> On Mar 9, 2008, at 09:59, Jakub Narebski wrote:\n> \n> >This extension[3][4] optimises \"hg status\" command by asking file\n> >notification daemon about changed files instead of doing stat. I'm not\n> >sure how useful this extension is: inotify is Linux specific, and  \n> >Linux\n> >has fast stat... nevertheless this is one example where extension\n> >(plug-in) framework shows that it can do more than good scriptability.\n> \n> FWIW, OS X 10.5 has a similar functionality, called \"fsevents\",\n> as well as a much slower stat.\n\nWindows NT on NTFS has a file monitor system that works somewhat\nlike an inotify, but different enough that you gotta write totally\ndifferent code for it.  It also has a much slower stat.\n\nI have wanted to put something like this into git-gui, so that a\nrunning git-gui session can see changes made to your working dir\n\"live\".  But I haven't gotten around to writing it.  I did do some\nearly experiments on Windows NT + NTFS with a small C daemon that\nwatches the working directory, but it ran into issues about also\nneed to know what is inside .gitignore to properly avoid sending\nevents that git-gui doesn't want to know about.  Like say build\nobject files.  :-)\n\nI think the reason Git has never had such an \"extension\" is we are\njust that freaking fast when it comes to comparing the working tree\nto the index.  hg wasn't in the early days and that may have been\nwhat gave rise to the plugin.\n\n-- \nShawn.\n"},{"id":"71623","messageId":"20080310225821.GS13660@fieldses.org","threadId":"12606","inReplyTo":"20080310224318.GC8410@spearce.org","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2008-03-10T22:58:21Z","receivedAt":"2008-03-10T22:58:21Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Mon, Mar 10, 2008 at 06:43:18PM -0400, Shawn O. Pearce wrote:\n> I think the reason Git has never had such an \"extension\" is we are\n> just that freaking fast when it comes to comparing the working tree\n> to the index.\n\nNFS is an exception there; a git diff takes about 12 seconds for me.\nIt's easy to see why--ping time to the server is about a quarter of a\nmillisecond, so with some 24000 files to stat, and a roundtrip to the\nserver required for each, it would take at least 6 seconds even if there\nwas no other contribution to the stat latency.\n\nBut of course there's not much by way of file change notifications in\nthe current NFS protocol either, so that doesn't help.\n\nAt some point I tried patching git to do the stat's in parallel (the\ntotally lazy way--instead of modifying the existing code I just did an\nextra parallel stat of everything first, then threw the results away, so\nthe real work would be done with a hot cache on the client).  I could\nget it down to about 3.5 seconds that way, better though still annoying.\n\n--b.\n"},{"id":"71678","messageId":"47D6541F.8000503@op5.se","threadId":"12606","inReplyTo":"200803101938.09300.jnareb@gmail.com","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-03-11T09:42:55Z","receivedAt":"2008-03-11T09:42:55Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Jakub Narebski wrote:\n> \n> Mercurial extension | git equivalent (or proposal)\n> --------------------+------------------------------------\n> bisect              | git-bisect\n> \n> Footnotes:\n> ==========\n> (*) Directly inspired by git feature\n> (!) No direct equivalent, would be quite a work to add\n> (!!!) No equivalent, don't know if possible\n> \n\nIIRC, bisect should have a star here (or five, as it's a killer feature).\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"71681","messageId":"7vtzjdbngf.fsf@gitster.siamese.dyndns.org","threadId":"12606","inReplyTo":"47D6541F.8000503@op5.se","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-11T09:48:48Z","receivedAt":"2008-03-11T09:48:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n> Jakub Narebski wrote:\n>>\n>> Mercurial extension | git equivalent (or proposal)\n>> --------------------+------------------------------------\n>> bisect              | git-bisect\n>>\n>> Footnotes:\n>> ==========\n>> (*) Directly inspired by git feature\n>> (!) No direct equivalent, would be quite a work to add\n>> (!!!) No equivalent, don't know if possible\n>>\n>\n> IIRC, bisect should have a star here (or five, as it's a killer feature).\n\nHeh, why do we even care?  It is a norm that good features cross pollinate\nacross systems and who borrows ideas from whom does not really matter\nmuch.\n"},{"id":"71683","messageId":"200803111100.10302.jnareb@gmail.com","threadId":"12606","inReplyTo":"47D6541F.8000503@op5.se","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-11T10:00:08Z","receivedAt":"2008-03-11T10:00:08Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andreas Ericsson wrote:\n> Jakub Narebski wrote:\n> > \n> > Mercurial extension | git equivalent (or proposal)\n> > --------------------+------------------------------------\n> > bisect              | git-bisect\n> > \n> > Footnotes:\n> > ==========\n> > (*) Directly inspired by git feature\n> > (!) No direct equivalent, would be quite a work to add\n> > (!!!) No equivalent, don't know if possible\n> > \n> \n> IIRC, bisect should have a star here (or five, as it's a killer\n> feature). \n\nI was not sure if bisect extension didn't come to Mercurial from/via  \nBitKeeper; IIRC it was added at request of Linux kernel, but I might be \nmistaken...\n\nSo in short: the star isn't here because I was not sure.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"71686","messageId":"47D65CF9.60607@op5.se","threadId":"12606","inReplyTo":"7vtzjdbngf.fsf@gitster.siamese.dyndns.org","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-03-11T10:20:41Z","receivedAt":"2008-03-11T10:20:41Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Andreas Ericsson <ae@op5.se> writes:\n> \n>> Jakub Narebski wrote:\n>>> Mercurial extension | git equivalent (or proposal)\n>>> --------------------+------------------------------------\n>>> bisect              | git-bisect\n>>>\n>>> Footnotes:\n>>> ==========\n>>> (*) Directly inspired by git feature\n>>> (!) No direct equivalent, would be quite a work to add\n>>> (!!!) No equivalent, don't know if possible\n>>>\n>> IIRC, bisect should have a star here (or five, as it's a killer feature).\n> \n> Heh, why do we even care?  It is a norm that good features cross pollinate\n> across systems and who borrows ideas from whom does not really matter\n> much.\n\nBecause companies such as the one where I work pride themselves in using\nthe most innovative tools. Clearly, git is the most innovative tool here,\nsince its developers managed to cook up something so immensely useful as\n\"git bisect\" (which by the way is well-nigh single-handedly responsible\nfor reducing our average bugreport-to-fix time from 4 days to 6 hours).\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"72176","messageId":"200803151222.16731.jnareb@gmail.com","threadId":"12606","inReplyTo":"e03c8a420803130450y77fd4038h734d80b636fa30a6@mail.gmail.com","subject":"Re: Mercurial's only true \"plugin\" extension: inotify... and can it be done in Git?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-15T11:22:13Z","receivedAt":"2008-03-15T11:22:13Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: git mailing list, mercurial mailing list]\n\nOn Thu, 13 March 2008, Zdeněk Vráblík wrote:\n> On Mon, Mar 10, 2008, Jakub Narębski <jnareb@gmail.com> wrote:\n>>\n> ...\n>>  cvscommit           | see git-cvsexportcommit, git-cvsserver\n\nFirst, a word of warning. I use Git (and sometimes even contribute\nto it), and watch its mailing list; I know Mercurial only from \ndocumentation and a few discussions on #revctrl IRC channel. So now you \nshould know which way I tend to be biased ;-)\n \n> I have looked at git-cvsserver\n> http://www.kernel.org/pub/software/scm/git/docs/git-cvsserver.html\n> It doesn't put back changes from git to cvs server.\n> It uses cvs client to work with GIT repository.\n\nOn http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions\n\n   cvscommit            | Push changesets to CVS\n\nBut on the link on its wiki page we have\n\n  From: Simon 'corecode' Schubert\n  Imbeault, Jean-Christian wrote:\n  >\n  > Are there any tools available that can push an hg repository\n  > into CVS? \n  I've written the cvscommit extension, but it might be outdated and\n  maybe could use some structural changes, but I've used it for some\n  commits.\n\nThere is no documentation for this extension, unfortunately, so I don't \nknow what exactly it does.\n\n\nFrom listed git \"equivalents\"\n\n  git-cvsexportcommit  (1)  - Export a single commit to a CVS checkout\n  git-cvsserver        (1)  - A CVS server emulator for git\n\nit looks like git-cvsexportcommit is more equivalent to hg.ext.cvscommit\nMercurial extension.\n\n> Does Mercurial has something like this? I use Mercurial personally and\n> I like it. But to migrate from cvs I need persuade all team. It will\n> be easier to do it with such cvs emulator.\n\nI don't know of such extension / tool\n\n> Thanks for the comparison.\n\nYou are welcome.\n-- \nJakub Narebski\nPoland\n"}]}