From: Pratyush Yadav Date: Mon, 02 Mar 2020 18:14:52 GMT Subject: Re: [PATCH v7 2/3] git-gui: update status bar to track operations Message-ID: <20200302181452.gssh43l2sxu7kqak@yadavpratyush.com> In-Reply-To: <20200226082409.GA2270319@f3> Hi Benjamin, On 26/02/20 05:24PM, Benjamin Poirier wrote: > On 2019/12/01 02:28 +0000, Jonathan Gilbert via GitGitGadget wrote: > > From: Jonathan Gilbert > > > > Update the status bar to track updates as individual "operations" that > > can overlap. Update all call sites to interact with the new status bar > > mechanism. Update initialization to explicitly clear status text, > > since otherwise it may persist across future operations. > > > > Signed-off-by: Jonathan Gilbert > > --- > > Hi Jonathan, > > It appears that this change has caused a regression when using git-gui > blame -> right click on a source line -> "Show History Context" > > There is an "Application Error" window that appears with the following > details: > can't read "::main_status": no such variable > can't read "::main_status": no such variable > while executing > "$::main_status start [mc "Starting %s... please wait..." "gitk"]" > (procedure "do_gitk" line 55) > invoked from within > "do_gitk $cmdline" > (procedure "blame::_gitkcommit" line 47) > invoked from within > "blame::_gitkcommit ::blame::__o1::__d" > invoked from within > ".ctxm invoke active" > ("uplevel" body line 1) > invoked from within > "uplevel #0 [list $w invoke active]" > (procedure "tk::MenuInvoke" line 50) > invoked from within > "tk::MenuInvoke .ctxm 1" > (command bound to event) > > The rest of the functionality seems unaffected but it's pretty annoying > to have to dismiss this message each time. > > Can you please look into it? Does the following patch fix the problem? I will submit a proper patch soon. -----8<----- diff --git a/git-gui.sh b/git-gui.sh index f41ed2e..d939844 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2205,11 +2205,13 @@ proc do_gitk {revs {is_submodule false}} { set env(GIT_WORK_TREE) $_gitworktree cd $pwd - set status_operation [$::main_status \ - start \ - [mc "Starting %s... please wait..." "gitk"]] + if {[info exists main_status]} { + set status_operation [$::main_status \ + start \ + [mc "Starting %s... please wait..." "gitk"]] - after 3500 [list $status_operation stop] + after 3500 [list $status_operation stop] + } } } -----8<----- -- Regards, Pratyush Yadav