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

Re: [PATCH] git-gui: Perform rescan on window focus-in

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 29, 2019, 05:09 UTC
Message-ID
<xmqqef29l94s.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190728224943.GC162590@genre.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 13 quoted lines
> These are probably pretty cheap on all but the largest repositories. I
> was worried we were enumerating all refs or all history or something
> like that.
>
>> ui_do_rescan changes the focus to the first diff. It is executed when you
>> press F5 or choose Rescan from the menu. do_rescan does not do that.
>> 
>> Resetting to first diff on focus change will get annoying when you are in
>> the middle of looking at some other file. do_rescan just updates the
>> software state without changing what file you are looking at or where in
>> that file you are looking at.
>
> Yeah, this definitely seems like the right move.

"Right move" in the sense that it would try not to change what is being shown too much. Rescan will still not be without cost, so it will be annoying if it happens when the user did not make any change.

And it is annoying even more, if the user did make change in another window. You may make a change perhaps from the command line, write a short e-mail about it to let others know in your MUA, and then switch the focus back to git-gui to continue working. Refreshing upon git-gui getting focus is no better than manually pressing F5 or whatever at that point. It is too late at that point for spending extra cycles without being asked without getting annoying to the user.

The right time to spend cycles (in the background) in the above sample sequence is immediately after you made a change and switch to your MUA---while you are typing a few paragraphs, you would not mind git-gui spending seconds to repaint.

So probably a more productive use of our time, if we were to futz with git-gui, would be to figure out how git-gui can have an background idle process that notices a change in the repository and refreshes but only when you are *not* interacting with it (if it does things while you are interacting with it, it would become annoying and distracting), I would guess. Just when you come back is the worst, and the most annoying, time to auto-refresh.

Previous: Mark LevedahlNext: Pratyush Yadav
Message 21 of 23 in “git-gui: Perform rescan on window focus-in”
  1. git-gui: Perform rescan on window focus-inPratyush Yadav, Jul 28, 2019
  2. brian m. carlsonJul 28, 2019
  3. Pratyush YadavJul 28, 2019
  4. Pratyush YadavJul 28, 2019
  5. brian m. carlsonJul 28, 2019
  6. Mark LevedahlJul 29, 2019
  7. Mark LevedahlJul 29, 2019
  8. Pratyush YadavJul 29, 2019
  9. Johannes SchindelinJul 31, 2019
  10. Pratyush YadavAug 1, 2019
  11. Johannes SchindelinAug 2, 2019
  12. Pratyush YadavAug 2, 2019
  13. Johannes SchindelinAug 3, 2019
  14. Pratyush YadavAug 4, 2019
  15. Johannes SchindelinAug 4, 2019
  16. Pratyush YadavAug 4, 2019
  17. Junio C HamanoAug 2, 2019
  18. Pratyush YadavAug 2, 2019
  19. Johannes SchindelinAug 4, 2019
  20. Mark LevedahlJul 29, 2019
  21. Junio C HamanoJul 29, 2019
  22. Pratyush YadavJul 29, 2019
  23. Pratyush YadavJul 28, 2019

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.