[PATCH 2/2] git-gui: Auto-rescan on activate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 using
"git config gui.autorescan false".

Signed-off-by: Stefan Haller <stefan@xxxxxxxxxxxxxxxx>
---
 git-gui.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/git-gui.sh b/git-gui.sh
index 8864c14..4a4ac19 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
 
 ######################################################################
 ##
@@ -4020,6 +4021,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>  schedule_rescan
+}
+
 set file_lists_last_clicked($ui_index) {}
 set file_lists_last_clicked($ui_workdir) {}
 
-- 
2.29.2




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux