threads / patch / 18737

patchgit-gui: use of undeclared variable in handle_empty_diff

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

## tl;dr

3 messages between Apr 5, 2009 and Apr 5, 2009. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Joerg Bornemann· Apr 5, 2009, 20:20 UTC · lore

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.

Show changes to git-gui.sh +1 −1
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"
Sverre Rabbelier· Apr 5, 2009, 21:20 UTC · re: Joerg Bornemann · lore

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

Heya,
On Sun, Apr 5, 2009 at 22:20, Joerg Bornemann <git@jbornemann.de> wrote:
> Commit 584fa9cc ("git-gui: Avoid an infinite rescan loop in

Please submit your patch as documented by SubmittingPatches (e.g., include a "Signed off by" line, use the formatting as generated by 'git format-patch', inline the patch rather than attaching it, etc). Thanks!

-- 
Cheers,

Sverre Rabbelier
Johannes Schindelin· Apr 5, 2009, 21:35 UTC · re: Joerg Bornemann · lore

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

Hi,
On Sun, 5 Apr 2009, Joerg Bornemann wrote:
Show 6 quoted lines
> 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.
Under which circumstances does this bug trigger?  I never saw it happen.

Ciao, Dscho

← back to recent threads