From: Shawn O. Pearce Date: Wed, 3 Oct 2007 04:17:19 +0000 (-0400) Subject: Merge branch 'maint' X-Git-Tag: gitgui-0.9.0~47 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e73bfa7709b108575e6ea73d6e97fc3efd967b38;p=git.git Merge branch 'maint' * maint: git-gui: Don't crash when starting gitk from a browser session git-gui: Allow gitk to be started on Cygwin with native Tcl/Tk Conflicts: git-gui.sh --- e73bfa7709b108575e6ea73d6e97fc3efd967b38 diff --cc git-gui.sh index 82f873bdc,cf88a0d82..3f5927fb2 --- a/git-gui.sh +++ b/git-gui.sh @@@ -1575,9 -1472,29 +1581,29 @@@ proc do_gitk {revs} set exe [file join [file dirname $::_git] gitk] set cmd [list [info nameofexecutable] $exe] if {! [file exists $exe]} { - error_popup "Unable to start gitk:\n\n$exe does not exist" + error_popup [mc "Unable to start gitk:\n\n%s does not exist" $exe] } else { + global env + + if {[info exists env(GIT_DIR)]} { + set old_GIT_DIR $env(GIT_DIR) + } else { + set old_GIT_DIR {} + } + + set pwd [pwd] + cd [file dirname [gitdir]] + set env(GIT_DIR) [file tail [gitdir]] + eval exec $cmd $revs & + + if {$old_GIT_DIR eq {}} { + unset env(GIT_DIR) + } else { + set env(GIT_DIR) $old_GIT_DIR + } + cd $pwd + ui_status $::starting_gitk_msg after 10000 { ui_ready $starting_gitk_msg