#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
-exec wish "$0" -- "$@"
+ if test "z$*" = zversion \
+ || test "z$*" = z--version; \
+ then \
+ echo 'git-gui version @@GITGUI_VERSION@@'; \
+ exit; \
+ fi; \
+ exec wish "$0" -- "$@"
set appvers {@@GITGUI_VERSION@@}
set copyright {
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
+######################################################################
+##
+## Tcl/Tk sanity check
+
+if {[catch {package require Tcl 8.4} err]
+ || [catch {package require Tk 8.4} err]
+} {
+ catch {wm withdraw .}
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title "git-gui: fatal error" \
+ -message $err
+ exit 1
+}
+
######################################################################
##
## enable verbose loading?
##
## version check
-if {{--version} eq $argv || {version} eq $argv} {
- puts "git-gui version $appvers"
- exit
-}
-
set req_maj 1
set req_min 5
if {![$ui_comm edit modified]
|| [string trim [$ui_comm get 0.0 end]] eq {}} {
- if {[load_message GITGUI_MSG]} {
+ if {[string match amend* $commit_type]} {
+ } elseif {[load_message GITGUI_MSG]} {
} elseif {[load_message MERGE_MSG]} {
} elseif {[load_message SQUASH_MSG]} {
}
incr sz $amt
font configure $font -size $sz
font configure ${font}bold -size $sz
+ font configure ${font}italic -size $sz
}
######################################################################
# lets us bypass using shell process on Windows systems.
#
set cmd [list [info nameofexecutable]]
- lappend cmd [gitexec gitk]
+ set exe [gitexec gitk]
+ lappend cmd $exe
if {$revs ne {}} {
append cmd { }
append cmd $revs
}
- if {[catch {eval exec $cmd &} err]} {
- error_popup "Failed to start gitk:\n\n$err"
+ if {! [file exists $exe]} {
+ error_popup "Unable to start gitk:\n\n$exe does not exist"
} else {
+ eval exec $cmd &
set ui_status_value $starting_gitk_msg
after 10000 {
if {$ui_status_value eq $starting_gitk_msg} {
destroy .dummy
}
+font create font_uiitalic
font create font_uibold
font create font_diffbold
+font create font_diffitalic
foreach class {Button Checkbutton Entry Label
Labelframe Listbox Menu Message
- Radiobutton Text} {
+ Radiobutton Spinbox Text} {
option add *$class.font font_ui
}
unset class
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv
+ font configure ${font}italic $cn $cv
}
font configure ${font}bold -weight bold
+ font configure ${font}italic -slant italic
}
}
# -- Tools Menu
#
- if {[file exists /usr/local/miga/lib/gui-miga]
- && [file exists .pvcsrc]} {
+ if {[is_Cygwin] && [file exists /usr/local/miga/lib/gui-miga]} {
proc do_miga {} {
global ui_status_value
if {![lock_index update]} return
# -- Standard bindings
#
-bind . <Destroy> do_quit
+wm protocol . WM_DELETE_WINDOW do_quit
bind all <$M1B-Key-q> do_quit
bind all <$M1B-Key-Q> do_quit
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
#
frame .vpane.files.index -height 100 -width 200
label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
- -background green
+ -background lightgreen
text $ui_index -background white -borderwidth 0 \
-width 20 -height 10 \
-wrap none \
#
frame .vpane.files.workdir -height 100 -width 200
label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
- -background red
+ -background lightsalmon
text $ui_workdir -background white -borderwidth 0 \
-width 20 -height 10 \
-wrap none \
.vpane.files add .vpane.files.workdir -sticky nsew
foreach i [list $ui_index $ui_workdir] {
- $i tag conf in_diff -font font_uibold
- $i tag conf in_sel \
- -background [$i cget -foreground] \
- -foreground [$i cget -background]
+ $i tag conf in_diff -background lightgray
+ $i tag conf in_sel -background lightgray
}
unset i
}
trace add variable current_diff_path write trace_current_diff_path
-frame .vpane.lower.diff.header -background orange
+frame .vpane.lower.diff.header -background gold
label .vpane.lower.diff.header.status \
- -background orange \
+ -background gold \
-width $max_status_desc \
-anchor w \
-justify left
label .vpane.lower.diff.header.file \
- -background orange \
+ -background gold \
-anchor w \
-justify left
label .vpane.lower.diff.header.path \
- -background orange \
+ -background gold \
-anchor w \
-justify left
pack .vpane.lower.diff.header.status -side left