git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* Auto Rescan - as plain text
       [not found]   ` <816ce248ab1708d41b5233abdb998ff2d4cb3400.camel@fgcint.com>
@ 2020-06-10  0:09     ` Luigi Cantoni
  2020-06-10  0:16       ` Junio C Hamano
  2020-06-10  8:51       ` Pratyush Yadav
  0 siblings, 2 replies; 6+ messages in thread
From: Luigi Cantoni @ 2020-06-10  0:09 UTC (permalink / raw)
  To: git

Hi All,
I have been using git for several years now and using git-cola.
I just started up git gui and that is quite self explanatory and all
the functions I use with git-cola appear to be there.

One thing I liked in git-cola was that it very quickly reflected my
changes in its display window.
I have looked in the options and I cannot see either a flag to set it
to auto rescan or set a time for the auto rescan.

Have I missed it and there is a way turn this on or give it a shorter
time (if in fact it is does do it).
If it is not offered could it become an option.
I can see that some people may not feel the overhead for distributed
system is worth having this on so they would want if off.
It is not critical (just nice) as I know I can
1) rescan
or 2) go off the file and back on again.
It then displays the correct diff/updated contents.

Thanks for any advise or help.
-- 

Thanks
Luigi Cantoni
M: +61 421 624 804
T: +61 8 9418 3777
Email: luigic@fgcint.com
-- 
Thanks
Luigi Cantoni
M: +61 421 624 804
T: +61 8 9418 3777
Email: luigic@fgcint.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto Rescan - as plain text
  2020-06-10  0:09     ` Auto Rescan - as plain text Luigi Cantoni
@ 2020-06-10  0:16       ` Junio C Hamano
  2020-06-10  8:59         ` Pratyush Yadav
  2020-06-10  8:51       ` Pratyush Yadav
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2020-06-10  0:16 UTC (permalink / raw)
  To: Luigi Cantoni, David Aguilar; +Cc: git

Luigi Cantoni <luigic@fgcint.com> writes:

> Hi All,
> I have been using git for several years now and using git-cola.
> I just started up git gui and that is quite self explanatory and all
> the functions I use with git-cola appear to be there.

We used to see the maintainer of that project around here quite
frequently but haven't seen him for a while [jch: David Cc'ed].

By reading https://git-cola.github.io/about.html it seems that they
prefer to see problem reports and feature requests at
https://github.com/git-cola/git-cola/issues and not on this list.

>
> One thing I liked in git-cola was that it very quickly reflected my
> changes in its display window.
> I have looked in the options and I cannot see either a flag to set it
> to auto rescan or set a time for the auto rescan.
>
> Have I missed it and there is a way turn this on or give it a shorter
> time (if in fact it is does do it).
> If it is not offered could it become an option.
> I can see that some people may not feel the overhead for distributed
> system is worth having this on so they would want if off.
> It is not critical (just nice) as I know I can
> 1) rescan
> or 2) go off the file and back on again.
> It then displays the correct diff/updated contents.
>
> Thanks for any advise or help.
> -- 
>
> Thanks
> Luigi Cantoni
> M: +61 421 624 804
> T: +61 8 9418 3777
> Email: luigic@fgcint.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto Rescan - as plain text
  2020-06-10  0:09     ` Auto Rescan - as plain text Luigi Cantoni
  2020-06-10  0:16       ` Junio C Hamano
@ 2020-06-10  8:51       ` Pratyush Yadav
  1 sibling, 0 replies; 6+ messages in thread
From: Pratyush Yadav @ 2020-06-10  8:51 UTC (permalink / raw)
  To: Luigi Cantoni; +Cc: git

Hi Luigi,

On 10/06/20 08:09AM, Luigi Cantoni wrote:
> Hi All,
> I have been using git for several years now and using git-cola.
> I just started up git gui and that is quite self explanatory and all
> the functions I use with git-cola appear to be there.
> 
> One thing I liked in git-cola was that it very quickly reflected my
> changes in its display window.
> I have looked in the options and I cannot see either a flag to set it
> to auto rescan or set a time for the auto rescan.

I proposed a patch for it some time back [0] and there was quite a 
lengthy discussion on the topic. I proposed rescanning every time the 
git-gui window came back into focus. But people had performance 
concerns. One person reported that a rescan took 8 seconds on their 
corporate Windows laptop (in my very limited experience using Git on 
Windows, I observed it is generally quite a bit slower than on Linux).

You can read through the linked thread to see the full discussion. In 
the end I dropped it because I couldn't find a reasonable compromise.
 
> Have I missed it and there is a way turn this on or give it a shorter
> time (if in fact it is does do it).
> If it is not offered could it become an option.

It might be worth looking into putting the automatic rescan behind a 
config option that is disabled by default so only people who really want 
it and know it won't hurt their workflow can use it, and it stays off 
for the rest of them. I dunno.

> I can see that some people may not feel the overhead for distributed
> system is worth having this on so they would want if off.
> It is not critical (just nice) as I know I can
> 1) rescan
> or 2) go off the file and back on again.
> It then displays the correct diff/updated contents.
> 
> Thanks for any advise or help.

[0] https://lore.kernel.org/git/20190728151726.9188-1-me@yadavpratyush.com/T/#u

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto Rescan - as plain text
  2020-06-10  0:16       ` Junio C Hamano
@ 2020-06-10  8:59         ` Pratyush Yadav
  2020-06-10 16:57           ` Junio C Hamano
  2020-06-30  6:37           ` David Aguilar
  0 siblings, 2 replies; 6+ messages in thread
From: Pratyush Yadav @ 2020-06-10  8:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Luigi Cantoni, David Aguilar, git

Hi Junio,

On 09/06/20 05:16PM, Junio C Hamano wrote:
> Luigi Cantoni <luigic@fgcint.com> writes:
> 
> > Hi All,
> > I have been using git for several years now and using git-cola.
> > I just started up git gui and that is quite self explanatory and all
> > the functions I use with git-cola appear to be there.
> 
> We used to see the maintainer of that project around here quite
> frequently but haven't seen him for a while [jch: David Cc'ed].
> 
> By reading https://git-cola.github.io/about.html it seems that they
> prefer to see problem reports and feature requests at
> https://github.com/git-cola/git-cola/issues and not on this list.

The feature request is for git-gui, asking for auto rescan in git-gui 
like git-cola has. So I think this is the right place for it. Though I 
think its easy to miss that on a quick read of the email. I had to do a 
double take too :-)
 
> > One thing I liked in git-cola was that it very quickly reflected my
> > changes in its display window.
> > I have looked in the options and I cannot see either a flag to set it
> > to auto rescan or set a time for the auto rescan.
> >
> > Have I missed it and there is a way turn this on or give it a shorter
> > time (if in fact it is does do it).
> > If it is not offered could it become an option.
> > I can see that some people may not feel the overhead for distributed
> > system is worth having this on so they would want if off.
> > It is not critical (just nice) as I know I can
> > 1) rescan
> > or 2) go off the file and back on again.
> > It then displays the correct diff/updated contents.
> >
> > Thanks for any advise or help.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto Rescan - as plain text
  2020-06-10  8:59         ` Pratyush Yadav
@ 2020-06-10 16:57           ` Junio C Hamano
  2020-06-30  6:37           ` David Aguilar
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2020-06-10 16:57 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Luigi Cantoni, David Aguilar, git

Pratyush Yadav <me@yadavpratyush.com> writes:

> Hi Junio,
>
> On 09/06/20 05:16PM, Junio C Hamano wrote:
>> Luigi Cantoni <luigic@fgcint.com> writes:
>> 
>> > Hi All,
>> > I have been using git for several years now and using git-cola.
>> > I just started up git gui and that is quite self explanatory and all
>> > the functions I use with git-cola appear to be there.
>> 
>> We used to see the maintainer of that project around here quite
>> frequently but haven't seen him for a while [jch: David Cc'ed].
>> 
>> By reading https://git-cola.github.io/about.html it seems that they
>> prefer to see problem reports and feature requests at
>> https://github.com/git-cola/git-cola/issues and not on this list.
>
> The feature request is for git-gui, asking for auto rescan in git-gui 
> like git-cola has.

Sorry for the noise, and thanks for your correction.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto Rescan - as plain text
  2020-06-10  8:59         ` Pratyush Yadav
  2020-06-10 16:57           ` Junio C Hamano
@ 2020-06-30  6:37           ` David Aguilar
  1 sibling, 0 replies; 6+ messages in thread
From: David Aguilar @ 2020-06-30  6:37 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Junio C Hamano, Luigi Cantoni, git

On Wed, Jun 10, 2020 at 02:29:02PM +0530, Pratyush Yadav wrote:
> Hi Junio,
> 
> On 09/06/20 05:16PM, Junio C Hamano wrote:
> > Luigi Cantoni <luigic@fgcint.com> writes:
> > 
> > > Hi All,
> > > I have been using git for several years now and using git-cola.
> > > I just started up git gui and that is quite self explanatory and all
> > > the functions I use with git-cola appear to be there.
> > 
> > We used to see the maintainer of that project around here quite
> > frequently but haven't seen him for a while [jch: David Cc'ed].
> > 
> > By reading https://git-cola.github.io/about.html it seems that they
> > prefer to see problem reports and feature requests at
> > https://github.com/git-cola/git-cola/issues and not on this list.
> 
> The feature request is for git-gui, asking for auto rescan in git-gui 
> like git-cola has. So I think this is the right place for it. Though I 
> think its easy to miss that on a quick read of the email. I had to do a 
> double take too :-)

Hi, I'm glad you like git-cola.

In the OP missed it, the git-gui maintainer's repo is here:

https://github.com/prati0100/git-gui


> > > One thing I liked in git-cola was that it very quickly reflected my
> > > changes in its display window.
> > > I have looked in the options and I cannot see either a flag to set it
> > > to auto rescan or set a time for the auto rescan.
> > >
> > > Have I missed it and there is a way turn this on or give it a shorter
> > > time (if in fact it is does do it).
> > > If it is not offered could it become an option.
> > > I can see that some people may not feel the overhead for distributed
> > > system is worth having this on so they would want if off.
> > > It is not critical (just nice) as I know I can
> > > 1) rescan
> > > or 2) go off the file and back on again.
> > > It then displays the correct diff/updated contents.
> > >
> > > Thanks for any advise or help.
> 
> -- 
> Regards,
> Pratyush Yadav


I'd be happy to explain how we implemented the "live refresh feature
in git-cola.

We have a few different approaches.  First, we integrate with inotify
on Linux.  When we notice that files have been written, we refresh our
state.  That's the happy path.

On Windows someone wrote an equivalent thing using some Windows file
monitoring APIs.

I don't think we currently have a macOS file monitoring part yet, but I
imagine there's probably a way to do it there too.

We're in Python, so we had the flexibility of what Python provides.
Git GUI will have access to anything tcl/tk / wish can do, but I'm
not familiar enough to know what's possible.

One thing we did do for users that don't have native file monitoring, is
that someone requested a preference, eg. "gui.refreshOnFocus", which
would make the GUI refresh whenever it gets focus from the window
manager.  This can be helpful, though it will make it take that extra
hit every time you switch between windows.  That might be something
that's possible to implement if something like inotify is not available,
though, and can be convenient for users that don't mind the hit.

Question for Luigui, how do you refresh the GUI?
Do you click on the "Rescan" button, or do you use the "Ctrl-R" hotkey?

One very nice but subtle detail that is not immediately obvious
from your description of how git-cola works is that if you have a file
selected, and something changes, we refresh the diff and keep the
viewport at the same location so that the changes appear right there,
immediately.  You mentioned:

> or 2) go off the file and back on again.

Which suggests that you have to deselect the file and reselect it to get
git-gui to redo the diff display.  You'll also lose the scrollbar
position if you do that, eg. if you are scrolled in the middle of a
large diff, you're going to lose your place.  That's why we
special-cased this behavior in cola and made it so that the rescan
behavior will redo the diff when a file is selected.

We go through great effort in cola to handle this in the nicest way
possible.  We  retaining the scrollbar/viewport position, redo the
diff, and ensure that if the user had something selected in the
text area, and the diff changes, that we attempt to re-select the text
that they may have selected, even if it changed lines.  The selection is
moreso content-centric than line-centric.

If they had something selected that went away, then their text selection
will be lost, but that's totally expected and natural.

I have a lot of opinions about how that tool should work, whch is really
why git-cola exists.  The diff/index editing part is really the killer
feature.

I ask how you refresh the GUI because cola is designed to be driven
entirely by keyboard shortcuts, and has vim-like hotkeys because I dig
building upon existing conventions and my vim muscle memory.

My main sug for git-gui would be to make it so that you don't have to
use a mouse.  Making it so that it can do the entire partial
staging/unstaging/revert workflow using line selection and keyboard
hotkeys would be my personal sug for feature requests.

If someone adds it, please use the "s" hotkey to stage/unstage selected
lines (or the hunk at the text cursor position, if nothing is selected),
"ctrl-u" to revert changes the same way, and "ctrl-s" to stage/unstage
the entire file, would be my personal sugs.

Parity with git-cola is always a nice goal within reason ;-) that way
folks won't have to re-learn these hotkeys across the tools.
-- 
David

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <37bd22ee8bcb9c91969d68cbc5e6852a8a70ab36.camel@fgcint.com>
     [not found] ` <bf895dc550881b35baea45cd269bf9b0518ade35.camel@fgcint.com>
     [not found]   ` <816ce248ab1708d41b5233abdb998ff2d4cb3400.camel@fgcint.com>
2020-06-10  0:09     ` Auto Rescan - as plain text Luigi Cantoni
2020-06-10  0:16       ` Junio C Hamano
2020-06-10  8:59         ` Pratyush Yadav
2020-06-10 16:57           ` Junio C Hamano
2020-06-30  6:37           ` David Aguilar
2020-06-10  8:51       ` Pratyush Yadav

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git