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

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

From
Stefan Haller <stefan@haller-berlin.de>
Date
Nov 3, 2020, 16:16 UTC
Message-ID
<20201103161631.89971-2-stefan@haller-berlin.de>
In-Reply-To
<20201103161631.89971-1-stefan@haller-berlin.de>

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>
---
 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
Previous: Stefan HallerNext: Stefan Haller
Message 11 of 21 in “git-gui: Auto-rescan on activate”
  1. 0/2 git-gui: Auto-rescan on activateStefan Haller, Nov 1, 2020
  2. 2/2 git-gui: Auto-rescan on activateStefan Haller, Nov 1, 2020
  3. Pratyush YadavNov 2, 2020
  4. Stefan HallerNov 2, 2020
  5. 1/2 git-gui: Delay rescan until idle timeStefan Haller, Nov 1, 2020
  6. Pratyush YadavNov 2, 2020
  7. Stefan HallerNov 2, 2020
  8. Pratyush YadavNov 2, 2020
  9. Stefan HallerNov 2, 2020
  10. 0/1 git-gui: Auto-rescan on activateStefan Haller, Nov 3, 2020
  11. 1/1 git-gui: Auto-rescan on activateStefan Haller, Nov 3, 2020
  12. Stefan HallerNov 14, 2020
  13. Pratyush YadavNov 17, 2020
  14. Stefan HallerNov 17, 2020
  15. Pratyush YadavNov 17, 2020
  16. Stefan HallerNov 18, 2020
  17. Johannes SixtDec 17, 2020
  18. Pratyush YadavDec 17, 2020
  19. Johannes SixtDec 17, 2020
  20. Stefan HallerDec 18, 2020
  21. Johannes SixtDec 18, 2020

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.