}
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 \