{"thread":{"id":"6860","subject":"exception in git-gui when saving options","startedAt":"2007-02-17T19:40:33Z","lastAt":"2007-02-18T07:14:58Z","messageCount":2,"participants":["Martin Waitz","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34891","messageId":"20070217194033.GH21842@admingilde.org","threadId":"6860","inReplyTo":null,"subject":"exception in git-gui when saving options","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-02-17T19:40:33Z","receivedAt":"2007-02-17T19:40:33Z","isPatch":false,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nI get the following backtrace when I want to save options in a\ngit-gui which is started in blame mode:\n\ncan't read \"current_diff_path\": no such variable\n    while executing\n\"set p $current_diff_path\"\n    (procedure \"reshow_diff\" line 5)\n    invoked from within\n\"reshow_diff\"\n    (procedure \"do_save_config\" line 5)\n    invoked from within\n\"do_save_config .options_editor\"\n    invoked from within\n\".options_editor.buttons.save invoke\"\n    (\"uplevel\" body line 1)\n    invoked from within\n\"uplevel #0 [list $w invoke]\"\n    (procedure \"tk::ButtonUp\" line 22)\n    invoked from within\n\"tk::ButtonUp .options_editor.buttons.save\"\n    (command bound to event)\n\nThe options seem to be saved correctly.\n\n-- \nMartin Waitz\n"},{"id":"34939","messageId":"20070218071457.GC31350@spearce.org","threadId":"6860","inReplyTo":"20070217194033.GH21842@admingilde.org","subject":"Re: exception in git-gui when saving options","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-18T07:14:58Z","receivedAt":"2007-02-18T07:14:58Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Martin Waitz <tali@admingilde.org> wrote:\n> I get the following backtrace when I want to save options in a\n> git-gui which is started in blame mode:\n> \n> The options seem to be saved correctly.\n\nWhoops.  :-)  Its fixed with the following commit in git-gui:\n\ncommit 372ef954a15c321a1065bf7e764449ce7767277f\nAuthor: Shawn O. Pearce <spearce@spearce.org>\nDate:   Sun Feb 18 02:12:32 2007 -0500\n\n    git-gui: Correct crash when saving options in blame mode.\n    \n    Martin Waitz noticed that git-gui crashed while saving the user's\n    options out if the application was started in blame mode.  This\n    was caused by the do_save_config procedure invoking reshow_diff\n    incase the number of context lines was modified by the user.\n    Because we bypassed main window UI setup to enter blame mode we\n    did not set many of the globals which were accessed by reshow_diff,\n    and reading unset variables is an error in Tcl.\n    \n    Aside from moving the globals to be set earlier, I also modified\n    reshow_diff to not invoke clear_diff if there is no path currently\n    in the diff viewer.  This way reshow_diff does not crash when in\n    blame mode due to the $ui_diff command not being defined.\n    \n    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n\n-- \nShawn.\n"}]}