{"thread":{"id":"53645","subject":"Auto Rescan - as plain text","startedAt":"2020-06-10T00:09:35Z","lastAt":"2020-06-30T06:37:14Z","messageCount":6,"participants":["Luigi Cantoni","Junio C Hamano","Pratyush Yadav","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"399380","messageId":"36bd7dc26883017770c28da94a251be2d5019f75.camel@fgcint.com","threadId":"53645","inReplyTo":"816ce248ab1708d41b5233abdb998ff2d4cb3400.camel@fgcint.com","subject":"Auto Rescan - as plain text","fromName":"Luigi Cantoni","fromEmail":"luigic@fgcint.com","sentAt":"2020-06-10T00:09:26Z","receivedAt":"2020-06-10T00:09:35Z","isPatch":false,"sender":{"key":"luigic@fgcint.com","avatar":null},"body":"Hi All,\nI have been using git for several years now and using git-cola.\nI just started up git gui and that is quite self explanatory and all\nthe functions I use with git-cola appear to be there.\n\nOne thing I liked in git-cola was that it very quickly reflected my\nchanges in its display window.\nI have looked in the options and I cannot see either a flag to set it\nto auto rescan or set a time for the auto rescan.\n\nHave I missed it and there is a way turn this on or give it a shorter\ntime (if in fact it is does do it).\nIf it is not offered could it become an option.\nI can see that some people may not feel the overhead for distributed\nsystem is worth having this on so they would want if off.\nIt is not critical (just nice) as I know I can\n1) rescan\nor 2) go off the file and back on again.\nIt then displays the correct diff/updated contents.\n\nThanks for any advise or help.\n-- \n\nThanks\nLuigi Cantoni\nM: +61 421 624 804\nT: +61 8 9418 3777\nEmail: luigic@fgcint.com\n-- \nThanks\nLuigi Cantoni\nM: +61 421 624 804\nT: +61 8 9418 3777\nEmail: luigic@fgcint.com\n"},{"id":"399381","messageId":"xmqq3673hj11.fsf@gitster.c.googlers.com","threadId":"53645","inReplyTo":"36bd7dc26883017770c28da94a251be2d5019f75.camel@fgcint.com","subject":"Re: Auto Rescan - as plain text","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-06-10T00:16:42Z","receivedAt":"2020-06-10T00:16:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luigi Cantoni <luigic@fgcint.com> writes:\n\n> Hi All,\n> I have been using git for several years now and using git-cola.\n> I just started up git gui and that is quite self explanatory and all\n> the functions I use with git-cola appear to be there.\n\nWe used to see the maintainer of that project around here quite\nfrequently but haven't seen him for a while [jch: David Cc'ed].\n\nBy reading https://git-cola.github.io/about.html it seems that they\nprefer to see problem reports and feature requests at\nhttps://github.com/git-cola/git-cola/issues and not on this list.\n\n>\n> One thing I liked in git-cola was that it very quickly reflected my\n> changes in its display window.\n> I have looked in the options and I cannot see either a flag to set it\n> to auto rescan or set a time for the auto rescan.\n>\n> Have I missed it and there is a way turn this on or give it a shorter\n> time (if in fact it is does do it).\n> If it is not offered could it become an option.\n> I can see that some people may not feel the overhead for distributed\n> system is worth having this on so they would want if off.\n> It is not critical (just nice) as I know I can\n> 1) rescan\n> or 2) go off the file and back on again.\n> It then displays the correct diff/updated contents.\n>\n> Thanks for any advise or help.\n> -- \n>\n> Thanks\n> Luigi Cantoni\n> M: +61 421 624 804\n> T: +61 8 9418 3777\n> Email: luigic@fgcint.com\n"},{"id":"399400","messageId":"20200610085139.l5sh3w4kwfwkxmfy@yadavpratyush.com","threadId":"53645","inReplyTo":"36bd7dc26883017770c28da94a251be2d5019f75.camel@fgcint.com","subject":"Re: Auto Rescan - as plain text","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-06-10T08:51:39Z","receivedAt":"2020-06-10T08:51:48Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi Luigi,\n\nOn 10/06/20 08:09AM, Luigi Cantoni wrote:\n> Hi All,\n> I have been using git for several years now and using git-cola.\n> I just started up git gui and that is quite self explanatory and all\n> the functions I use with git-cola appear to be there.\n> \n> One thing I liked in git-cola was that it very quickly reflected my\n> changes in its display window.\n> I have looked in the options and I cannot see either a flag to set it\n> to auto rescan or set a time for the auto rescan.\n\nI proposed a patch for it some time back [0] and there was quite a \nlengthy discussion on the topic. I proposed rescanning every time the \ngit-gui window came back into focus. But people had performance \nconcerns. One person reported that a rescan took 8 seconds on their \ncorporate Windows laptop (in my very limited experience using Git on \nWindows, I observed it is generally quite a bit slower than on Linux).\n\nYou can read through the linked thread to see the full discussion. In \nthe end I dropped it because I couldn't find a reasonable compromise.\n \n> Have I missed it and there is a way turn this on or give it a shorter\n> time (if in fact it is does do it).\n> If it is not offered could it become an option.\n\nIt might be worth looking into putting the automatic rescan behind a \nconfig option that is disabled by default so only people who really want \nit and know it won't hurt their workflow can use it, and it stays off \nfor the rest of them. I dunno.\n\n> I can see that some people may not feel the overhead for distributed\n> system is worth having this on so they would want if off.\n> It is not critical (just nice) as I know I can\n> 1) rescan\n> or 2) go off the file and back on again.\n> It then displays the correct diff/updated contents.\n> \n> Thanks for any advise or help.\n\n[0] https://lore.kernel.org/git/20190728151726.9188-1-me@yadavpratyush.com/T/#u\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"399401","messageId":"20200610085902.uv7cxl6s5qnlniwm@yadavpratyush.com","threadId":"53645","inReplyTo":"xmqq3673hj11.fsf@gitster.c.googlers.com","subject":"Re: Auto Rescan - as plain text","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-06-10T08:59:02Z","receivedAt":"2020-06-10T08:59:12Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi Junio,\n\nOn 09/06/20 05:16PM, Junio C Hamano wrote:\n> Luigi Cantoni <luigic@fgcint.com> writes:\n> \n> > Hi All,\n> > I have been using git for several years now and using git-cola.\n> > I just started up git gui and that is quite self explanatory and all\n> > the functions I use with git-cola appear to be there.\n> \n> We used to see the maintainer of that project around here quite\n> frequently but haven't seen him for a while [jch: David Cc'ed].\n> \n> By reading https://git-cola.github.io/about.html it seems that they\n> prefer to see problem reports and feature requests at\n> https://github.com/git-cola/git-cola/issues and not on this list.\n\nThe feature request is for git-gui, asking for auto rescan in git-gui \nlike git-cola has. So I think this is the right place for it. Though I \nthink its easy to miss that on a quick read of the email. I had to do a \ndouble take too :-)\n \n> > One thing I liked in git-cola was that it very quickly reflected my\n> > changes in its display window.\n> > I have looked in the options and I cannot see either a flag to set it\n> > to auto rescan or set a time for the auto rescan.\n> >\n> > Have I missed it and there is a way turn this on or give it a shorter\n> > time (if in fact it is does do it).\n> > If it is not offered could it become an option.\n> > I can see that some people may not feel the overhead for distributed\n> > system is worth having this on so they would want if off.\n> > It is not critical (just nice) as I know I can\n> > 1) rescan\n> > or 2) go off the file and back on again.\n> > It then displays the correct diff/updated contents.\n> >\n> > Thanks for any advise or help.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"399416","messageId":"xmqqv9jyg8pb.fsf@gitster.c.googlers.com","threadId":"53645","inReplyTo":"20200610085902.uv7cxl6s5qnlniwm@yadavpratyush.com","subject":"Re: Auto Rescan - as plain text","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-06-10T16:57:20Z","receivedAt":"2020-06-10T16:57:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pratyush Yadav <me@yadavpratyush.com> writes:\n\n> Hi Junio,\n>\n> On 09/06/20 05:16PM, Junio C Hamano wrote:\n>> Luigi Cantoni <luigic@fgcint.com> writes:\n>> \n>> > Hi All,\n>> > I have been using git for several years now and using git-cola.\n>> > I just started up git gui and that is quite self explanatory and all\n>> > the functions I use with git-cola appear to be there.\n>> \n>> We used to see the maintainer of that project around here quite\n>> frequently but haven't seen him for a while [jch: David Cc'ed].\n>> \n>> By reading https://git-cola.github.io/about.html it seems that they\n>> prefer to see problem reports and feature requests at\n>> https://github.com/git-cola/git-cola/issues and not on this list.\n>\n> The feature request is for git-gui, asking for auto rescan in git-gui \n> like git-cola has.\n\nSorry for the noise, and thanks for your correction.\n"},{"id":"400792","messageId":"20200630063706.GA1962986@gmail.com","threadId":"53645","inReplyTo":"20200610085902.uv7cxl6s5qnlniwm@yadavpratyush.com","subject":"Re: Auto Rescan - as plain text","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2020-06-30T06:37:06Z","receivedAt":"2020-06-30T06:37:14Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Jun 10, 2020 at 02:29:02PM +0530, Pratyush Yadav wrote:\n> Hi Junio,\n> \n> On 09/06/20 05:16PM, Junio C Hamano wrote:\n> > Luigi Cantoni <luigic@fgcint.com> writes:\n> > \n> > > Hi All,\n> > > I have been using git for several years now and using git-cola.\n> > > I just started up git gui and that is quite self explanatory and all\n> > > the functions I use with git-cola appear to be there.\n> > \n> > We used to see the maintainer of that project around here quite\n> > frequently but haven't seen him for a while [jch: David Cc'ed].\n> > \n> > By reading https://git-cola.github.io/about.html it seems that they\n> > prefer to see problem reports and feature requests at\n> > https://github.com/git-cola/git-cola/issues and not on this list.\n> \n> The feature request is for git-gui, asking for auto rescan in git-gui \n> like git-cola has. So I think this is the right place for it. Though I \n> think its easy to miss that on a quick read of the email. I had to do a \n> double take too :-)\n\nHi, I'm glad you like git-cola.\n\nIn the OP missed it, the git-gui maintainer's repo is here:\n\nhttps://github.com/prati0100/git-gui\n\n\n> > > One thing I liked in git-cola was that it very quickly reflected my\n> > > changes in its display window.\n> > > I have looked in the options and I cannot see either a flag to set it\n> > > to auto rescan or set a time for the auto rescan.\n> > >\n> > > Have I missed it and there is a way turn this on or give it a shorter\n> > > time (if in fact it is does do it).\n> > > If it is not offered could it become an option.\n> > > I can see that some people may not feel the overhead for distributed\n> > > system is worth having this on so they would want if off.\n> > > It is not critical (just nice) as I know I can\n> > > 1) rescan\n> > > or 2) go off the file and back on again.\n> > > It then displays the correct diff/updated contents.\n> > >\n> > > Thanks for any advise or help.\n> \n> -- \n> Regards,\n> Pratyush Yadav\n\n\nI'd be happy to explain how we implemented the \"live refresh feature\nin git-cola.\n\nWe have a few different approaches.  First, we integrate with inotify\non Linux.  When we notice that files have been written, we refresh our\nstate.  That's the happy path.\n\nOn Windows someone wrote an equivalent thing using some Windows file\nmonitoring APIs.\n\nI don't think we currently have a macOS file monitoring part yet, but I\nimagine there's probably a way to do it there too.\n\nWe're in Python, so we had the flexibility of what Python provides.\nGit GUI will have access to anything tcl/tk / wish can do, but I'm\nnot familiar enough to know what's possible.\n\nOne thing we did do for users that don't have native file monitoring, is\nthat someone requested a preference, eg. \"gui.refreshOnFocus\", which\nwould make the GUI refresh whenever it gets focus from the window\nmanager.  This can be helpful, though it will make it take that extra\nhit every time you switch between windows.  That might be something\nthat's possible to implement if something like inotify is not available,\nthough, and can be convenient for users that don't mind the hit.\n\nQuestion for Luigui, how do you refresh the GUI?\nDo you click on the \"Rescan\" button, or do you use the \"Ctrl-R\" hotkey?\n\nOne very nice but subtle detail that is not immediately obvious\nfrom your description of how git-cola works is that if you have a file\nselected, and something changes, we refresh the diff and keep the\nviewport at the same location so that the changes appear right there,\nimmediately.  You mentioned:\n\n> or 2) go off the file and back on again.\n\nWhich suggests that you have to deselect the file and reselect it to get\ngit-gui to redo the diff display.  You'll also lose the scrollbar\nposition if you do that, eg. if you are scrolled in the middle of a\nlarge diff, you're going to lose your place.  That's why we\nspecial-cased this behavior in cola and made it so that the rescan\nbehavior will redo the diff when a file is selected.\n\nWe go through great effort in cola to handle this in the nicest way\npossible.  We  retaining the scrollbar/viewport position, redo the\ndiff, and ensure that if the user had something selected in the\ntext area, and the diff changes, that we attempt to re-select the text\nthat they may have selected, even if it changed lines.  The selection is\nmoreso content-centric than line-centric.\n\nIf they had something selected that went away, then their text selection\nwill be lost, but that's totally expected and natural.\n\nI have a lot of opinions about how that tool should work, whch is really\nwhy git-cola exists.  The diff/index editing part is really the killer\nfeature.\n\nI ask how you refresh the GUI because cola is designed to be driven\nentirely by keyboard shortcuts, and has vim-like hotkeys because I dig\nbuilding upon existing conventions and my vim muscle memory.\n\nMy main sug for git-gui would be to make it so that you don't have to\nuse a mouse.  Making it so that it can do the entire partial\nstaging/unstaging/revert workflow using line selection and keyboard\nhotkeys would be my personal sug for feature requests.\n\nIf someone adds it, please use the \"s\" hotkey to stage/unstage selected\nlines (or the hunk at the text cursor position, if nothing is selected),\n\"ctrl-u\" to revert changes the same way, and \"ctrl-s\" to stage/unstage\nthe entire file, would be my personal sugs.\n\nParity with git-cola is always a nice goal within reason ;-) that way\nfolks won't have to re-learn these hotkeys across the tools.\n-- \nDavid\n"}]}