On 03.11.20 17:16, Stefan Haller wrote: > Do an automatic rescan whenever the git-gui window receives focus. Most other > GUI tools do this, and it's very convenient; no more pressing F5 manually. > > People who don't like this behavior can turn it off in the Options dialog. Ping - any thoughts? I have been running with this patch for a few weeks now, and I already don't want to miss it any more. Cc:-ing a few people who were involved in the discussion on Pratyush's similar patch last summer. [0] [0] <https://lore.kernel.org/git/20190728151726.9188-1- me@xxxxxxxxxxxxxxxxx/> > > Signed-off-by: Stefan Haller <stefan@xxxxxxxxxxxxxxxx> > --- > git-gui.sh | 5 +++++ > lib/option.tcl | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/git-gui.sh b/git-gui.sh > index 867b8ce..14735a3 100755 > --- a/git-gui.sh > +++ b/git-gui.sh > @@ -906,6 +906,7 @@ set font_descs { > } > set default_config(gui.stageuntracked) ask > set default_config(gui.displayuntracked) true > +set default_config(gui.autorescan) true > > ###################################################################### > ## > @@ -4007,6 +4008,10 @@ bind . <Alt-Key-2> {focus_widget $::ui_index} > bind . <Alt-Key-3> {focus $::ui_diff} > bind . <Alt-Key-4> {focus $::ui_comm} > > +if {[is_config_true gui.autorescan]} { > + bind . <FocusIn> { if {"%W" eq "."} do_rescan } > +} > + > set file_lists_last_clicked($ui_index) {} > set file_lists_last_clicked($ui_workdir) {} > > diff --git a/lib/option.tcl b/lib/option.tcl > index e43971b..9e83db7 100644 > --- a/lib/option.tcl > +++ b/lib/option.tcl > @@ -145,6 +145,7 @@ proc do_options {} { > {b merge.diffstat {mc "Show Diffstat After Merge"}} > {t merge.tool {mc "Use Merge Tool"}} > > + {b gui.autorescan {mc "Auto-Rescan On Activate"}} > {b gui.trustmtime {mc "Trust File Modification Timestamps"}} > {b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}} > {b gui.matchtrackingbranch {mc "Match Tracking Branches"}} > -- > 2.29.2 >