threads / discuss / 6860

exception in git-gui when saving options

Subject: exception in git-gui when saving options

## tl;dr

2 messages between Feb 17, 2007 and Feb 18, 2007.

replies: 1people: 2as markdown or json

Martin Waitz· Feb 17, 2007, 19:40 UTC · lore
hoi :)

I get the following backtrace when I want to save options in a git-gui which is started in blame mode:

can't read "current_diff_path": no such variable
    while executing
"set p $current_diff_path"
    (procedure "reshow_diff" line 5)
    invoked from within
"reshow_diff"
    (procedure "do_save_config" line 5)
    invoked from within
"do_save_config .options_editor"
    invoked from within
".options_editor.buttons.save invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .options_editor.buttons.save"
    (command bound to event)
The options seem to be saved correctly.
-- 
Martin Waitz
Shawn O. Pearce· Feb 18, 2007, 07:14 UTC · re: Martin Waitz · lore

Re: exception in git-gui when saving options

Martin Waitz <tali@admingilde.org> wrote:
> I get the following backtrace when I want to save options in a
> git-gui which is started in blame mode:
> 
> The options seem to be saved correctly.
Whoops.  :-)  Its fixed with the following commit in git-gui:
commit 372ef954a15c321a1065bf7e764449ce7767277f
Author: Shawn O. Pearce <spearce@spearce.org>
Date:   Sun Feb 18 02:12:32 2007 -0500
    git-gui: Correct crash when saving options in blame mode.
    
    Martin Waitz noticed that git-gui crashed while saving the user's
    options out if the application was started in blame mode.  This
    was caused by the do_save_config procedure invoking reshow_diff
    incase the number of context lines was modified by the user.
    Because we bypassed main window UI setup to enter blame mode we
    did not set many of the globals which were accessed by reshow_diff,
    and reading unset variables is an error in Tcl.
    
    Aside from moving the globals to be set earlier, I also modified
    reshow_diff to not invoke clear_diff if there is no path currently
    in the diff viewer.  This way reshow_diff does not crash when in
    blame mode due to the $ui_diff command not being defined.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-- 
Shawn.

← back to recent threads