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

[PATCH (GITK FIX)] gitk: Fix the "notflag: no such variable" error in --not processing.

From
Alexander Gavrilov <angavrilov@gmail.com>
Date
Dec 1, 2008, 17:25 UTC
Message-ID
<200812012025.25286.angavrilov@gmail.com>
In-Reply-To
<49341101.8050400@viscovery.net>

Commit 2958228430b63f2e38c55519d1f98d8d6d9e23f3 fixed the switch statement used in option processing, which made some of the previously unreachable cases executable. This uncovered the fact that the variable used in the handling of the --not option is not initialized.

This patch initializes it. Note that actually it is also possible to remove it completely, because currently nobody uses the value.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
	On Monday 01 December 2008 19:29:53 Johannes Sixt wrote:
	> > $ git bisect view
	> > Error in startup script: can't read "notflag": no such variable
	> >     while executing
	> > "expr {!$notflag}"
	> >     ("--not" arm line 2)
	> >     invoked from within
	> > "switch -glob -- $arg {
	> >             "-d" -
	> >             "--date-order" {
	> >                 set vdatemode($n) 1
	> >                 # remove from origargs in case we hit an unknown option
	> >                 set origarg..."
	> >     (procedure "parseviewargs" line 21)
	> >     invoked from within
	> > "parseviewargs $view $args"
	> >     (procedure "start_rev_list" line 27)
	> >     invoked from within
	> > "start_rev_list $curview"
	> >     (procedure "getcommits" line 5)
	> >     invoked from within
	> > "getcommits {}"
	> >     (file "/usr/local/bin/gitk" line 10897)
	>
	> Bisection points to this commit:
	> 
	> commit 2958228430b63f2e38c55519d1f98d8d6d9e23f3
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index f7f1776..6eaeadf 100755
--- a/gitk
+++ b/gitk
@@ -139,6 +139,7 @@ proc parseviewargs {n arglist} {
     set origargs $arglist
     set allknown 1
     set filtered 0
+    set notflag 0
     set i -1
     foreach arg $arglist {
 	incr i
-- 
1.6.0.4.30.gf4240
Previous: Johannes SixtNext: Paul Mackerras
Message 3 of 4 in “gitk: git bisect view doesn't work”
  1. Johannes SixtDec 1, 2008
  2. Johannes SixtDec 1, 2008
  3. gitk: Fix the "notflag: no such variable" error in --not processing.Alexander Gavrilov, Dec 1, 2008
  4. Paul MackerrasDec 1, 2008

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.