Skip to content

Commit

Permalink
git-gui: Allow gitk to be started on Cygwin with native Tcl/Tk
Browse files Browse the repository at this point in the history
gitk expects $env(GIT_DIR) to be valid as both a path that core Git
and Tcl/Tk can resolve to a valid directory, but it has no special
handling for Cygwin style UNIX paths and Windows style paths.  So
we need to do that for gitk and ensure that only relative paths are
fed to it, thus allowing both Cygwin style and UNIX style paths to
be resolved.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce committed Oct 3, 2007
1 parent 2fe167b commit 501e4c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,27 @@ proc do_gitk {revs} {
if {! [file exists $exe]} {
error_popup "Unable to start gitk:\n\n$exe does not exist"
} 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
Expand Down

0 comments on commit 501e4c6

Please sign in to comment.