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

[PATCH (GIT-GUI BUG)] git-gui: use of undeclared variable in handle_empty_diff

From
JBJoerg Bornemann <git@jbornemann.de>
Date
Apr 5, 2009, 20:20 UTC
Message-ID
<0337ff5648e5e0dc583e255a44573dbf@mb8-2.1blu.de>

Commit 584fa9cc ("git-gui: Avoid an infinite rescan loop in handle_empty_diff.") introduced the global variable diff_empty_count, which is used in diff.tcl. But this variable isn't declared anywhere which results in an ugly error message box instead of the intended informative message. This patch fixes this and removes the unnecessary second initialization of current_diff_path.

diff --git a/git-gui.sh b/git-gui.sh
index b3aa732..b0d5028 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1104,10 +1104,10 @@ set commit_type {}
 set empty_tree {}
 set current_branch {}
 set is_detached 0
-set current_diff_path {}
 set is_3way_diff 0
 set is_conflict_diff 0
 set selected_commit_type new
+set diff_empty_count 0
 
 set nullid "0000000000000000000000000000000000000000"
 set nullid2 "0000000000000000000000000000000000000001"
Next: Sverre Rabbelier
Message 1 of 3 in “git-gui: use of undeclared variable in handle_empty_diff”
  1. git-gui: use of undeclared variable in handle_empty_diffJoerg Bornemann, Apr 5, 2009
  2. Sverre RabbelierApr 5, 2009
  3. Johannes SchindelinApr 5, 2009

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.