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

[PATCH] git-gui: Update in-memory config when changing config options

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Aug 22, 2019, 22:33 UTC
Message-ID
<20190822223316.11153-1-me@yadavpratyush.com>

When the user updates any config variable from the options menu, the new config gets saved, but the in-memory state of the config variables is not updated. This results in the old settings being used until the user either opens the options menu again (which triggers a call to load_config), or re-starts git-gui.

This change fixes that problem by re-loading the config variables when the Save button is pressed in the options menu.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
---

The commit can be found in the topic branch 'py/reload-config' at https://github.com/prati0100/git-gui/tree/py/reload-config

Once reviewed, pull the commit 92582527b91750e47c2c3e4d1e2188998e9330ce or just munge the patch and apply it locally, whichever you prefer.

 lib/option.tcl | 1 +
 1 file changed, 1 insertion(+)
diff --git a/lib/option.tcl b/lib/option.tcl
index e43971b..139cf44 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -344,6 +344,7 @@ proc do_save_config {w} {
 	if {[catch {save_config} err]} {
 		error_popup [strcat [mc "Failed to completely save options:"] "\n\n$err"]
 	}
+	load_config 1
 	reshow_diff
 	destroy $w
 }
--
2.21.0
Next: Pratyush Yadav
Message 1 of 4 in “git-gui: Update in-memory config when changing config options”
  1. git-gui: Update in-memory config when changing config optionsPratyush Yadav, Aug 22, 2019
  2. Pratyush YadavAug 25, 2019
  3. Junio C HamanoAug 26, 2019
  4. Pratyush YadavAug 26, 2019

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.