summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 53f7a33)
raw | patch | inline | side by side (parent: 53f7a33)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 21 Nov 2006 16:57:41 +0000 (11:57 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 21 Nov 2006 16:57:41 +0000 (11:57 -0500) |
Like the is_MacOSX proc we shouldn't keep repeating the platform test
for Windows. Instead abstract the code out into a procedure and use
the procedure whenever we need to do something special.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
for Windows. Instead abstract the code out into a procedure and use
the procedure whenever we need to do something special.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index dfdce94cf6693ae6aa16d2909c9daebe7b8f9e06..3e53fbd623f14446de6aabb79614ce34ef6e0cfe 100755 (executable)
--- a/git-gui
+++ b/git-gui
}
proc commit_prehook {curHEAD msg} {
- global tcl_platform gitdir ui_status_value pch_error
+ global gitdir ui_status_value pch_error
+
+ set pchook [file join $gitdir hooks pre-commit]
# On Cygwin [file executable] might lie so we need to ask
# the shell if the hook is executable. Yes that's annoying.
-
- set pchook [file join $gitdir hooks pre-commit]
- if {$tcl_platform(platform) eq {windows}
- && [file isfile $pchook]} {
+ #
+ if {[is_Windows] && [file isfile $pchook]} {
set pchook [list sh -c [concat \
"if test -x \"$pchook\";" \
"then exec \"$pchook\" 2>&1;" \
proc commit_committree {fd_wt curHEAD msg} {
global HEAD PARENT MERGE_HEAD commit_type
- global single_commit gitdir tcl_platform
+ global single_commit gitdir
global ui_status_value ui_comm selected_commit_type
global file_states selected_paths rescan_active
# -- Run the post-commit hook.
#
set pchook [file join $gitdir hooks post-commit]
- if {$tcl_platform(platform) eq {windows} && [file isfile $pchook]} {
+ if {[is_Windows] && [file isfile $pchook]} {
set pchook [list sh -c [concat \
"if test -x \"$pchook\";" \
"then exec \"$pchook\";" \
return 0
}
+proc is_Windows {} {
+ global tcl_platform
+ if {$tcl_platform(platform) eq {windows}} {
+ return 1
+ }
+ return 0
+}
+
proc bind_button3 {w cmd} {
bind $w <Any-Button-3> $cmd
if {[is_MacOSX]} {
}
proc console_exec {w cmd {after {}}} {
- global tcl_platform
-
# -- Windows tosses the enviroment when we exec our child.
# But most users need that so we have to relogin. :-(
#
- if {$tcl_platform(platform) eq {windows}} {
+ if {[is_Windows]} {
set cmd [list sh --login -c "cd \"[pwd]\" && [join $cmd { }]"]
}
set starting_gitk_msg {Please wait... Starting gitk...}
proc do_gitk {} {
- global tcl_platform ui_status_value starting_gitk_msg
+ global ui_status_value starting_gitk_msg
set ui_status_value $starting_gitk_msg
after 10000 {
}
}
- if {$tcl_platform(platform) eq {windows}} {
+ if {[is_Windows]} {
exec sh -c gitk &
} else {
exec gitk &
set M1B M1
set M1T M1
-if {$tcl_platform(platform) eq {windows}} {
+if {[is_Windows]} {
set M1B Control
set M1T Ctrl
} elseif {[is_MacOSX]} {
.mbar.repository add separator
- if {$tcl_platform(platform) eq {windows}} {
+ if {[is_Windows]} {
.mbar.repository add command \
-label {Create Desktop Icon} \
-command do_windows_shortcut \