Skip to content

Commit 1dcce5d

Browse files
stefanhallerprati0100
authored andcommitted
git-gui: Auto-rescan on activate
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. Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
1 parent 38c2ac2 commit 1dcce5d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

git-gui.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ set font_descs {
906906
}
907907
set default_config(gui.stageuntracked) ask
908908
set default_config(gui.displayuntracked) true
909+
set default_config(gui.autorescan) true
909910
910911
######################################################################
911912
##
@@ -4007,6 +4008,10 @@ bind . <Alt-Key-2> {focus_widget $::ui_index}
40074008
bind . <Alt-Key-3> {focus $::ui_diff}
40084009
bind . <Alt-Key-4> {focus $::ui_comm}
40094010
4011+
if {[is_config_true gui.autorescan]} {
4012+
bind . <FocusIn> { if {"%W" eq "."} do_rescan }
4013+
}
4014+
40104015
set file_lists_last_clicked($ui_index) {}
40114016
set file_lists_last_clicked($ui_workdir) {}
40124017

lib/option.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ proc do_options {} {
145145
{b merge.diffstat {mc "Show Diffstat After Merge"}}
146146
{t merge.tool {mc "Use Merge Tool"}}
147147

148+
{b gui.autorescan {mc "Auto-Rescan On Activate"}}
148149
{b gui.trustmtime {mc "Trust File Modification Timestamps"}}
149150
{b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
150151
{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}

0 commit comments

Comments
 (0)