Re: [PATCH] git-gui: Perform rescan on window focus-in
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jul 28, 2019, 21:36 UTC
- Message-ID
- <20190728213634.GB162590@genre.crustytoothpaste.net>
- In-Reply-To
- <20190728151726.9188-1-me@yadavpratyush.com>
On 2019-07-28 at 15:17:26, Pratyush Yadav wrote:
Show 6 quoted lines
> If any changes are made to the tree while git-gui is open, the user has > to manually rescan to see those changes in the gui. With this change, a > rescan will be performed whenever the window comes in focus, removing > the need for manual rescans in most cases. A manual rescan will still be > needed when something makes changes to the tree while git-gui is still > in focus.
I don't use git-gui, so I have no opinion on this change either way, but I do have some questions.
What exactly is involved in a rescan? Is it potentially expensive? If so, it might be better to leave it explicit, since people can accidentally give focus to the wrong window (bad click, focus follows mouse, etc.).
Is there ever a situation in which someone might want to see the old state? For example, would a rescan change the active commit shown? Someone might be looking at a particular commit message or object ID for the current commit; would this interfere with that?
Show 9 quoted lines
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 6de74ce639..8ca2033dc8 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -3849,6 +3849,7 @@ if {[is_enabled transport]} {
> }
>
> bind . <Key-F5> ui_do_rescan
> +bind . <FocusIn> do_rescanWhat's the difference between these two? Why are we using do_rescan instead of ui_do_rescan?
> bind . <$M1B-Key-r> ui_do_rescan > bind . <$M1B-Key-R> ui_do_rescan > bind . <$M1B-Key-s> do_signoff
The answers to a lot of these questions can go in your commit message to help reviewers and future readers understand your change better.
-- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204