You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
-set gitgui_credits {
-Paul Mackerras
-}
######################################################################
##
if {[reponame] ne {}} {
append title " ([reponame])"
}
+ option add *Dialog.msg.font font_ui
+ option add *Button.font font_ui
set cmd [list tk_messageBox \
-icon error \
-type ok \
if {[reponame] ne {}} {
append title " ([reponame])"
}
+ option add *Dialog.msg.font font_ui
+ option add *Button.font font_ui
set cmd [list tk_messageBox \
-icon warning \
-type ok \
if {[reponame] ne {}} {
append title " ([reponame])"
}
+ option add *Dialog.msg.font font_ui
+ option add *Button.font font_ui
tk_messageBox \
-parent $parent \
-icon info \
if {[reponame] ne {}} {
append title " ([reponame])"
}
+ option add *Dialog.msg.font font_ui
+ option add *Button.font font_ui
return [tk_messageBox \
-parent . \
-icon question \
##
## version check
+if {{--version} eq $argv || {version} eq $argv} {
+ puts "git-gui version $appvers"
+ exit
+}
+
set req_maj 1
set req_min 5
[short_path $path] has no changes.
-The modification date of this file was updated
-by another application, but the content within
-the file was not changed.
+The modification date of this file was updated by another application, but the content within the file was not changed.
-A rescan will be automatically started to find
-other files which may have the same state."
+A rescan will be automatically started to find other files which may have the same state."
clear_diff
display_file $path __
if {[llength $PARENT] == 0} {
error_popup {There is nothing to amend.
-You are about to create the initial commit.
-There is no commit before this to amend.
+You are about to create the initial commit. There is no commit before this to amend.
}
return
}
if {$curType eq {merge}} {
error_popup {Cannot amend while merging.
-You are currently in the middle of a merge that
-has not been fully completed. You cannot amend
-the prior commit unless you first abort the
-current merge activity.
+You are currently in the middle of a merge that has not been fully completed. You cannot amend the prior commit unless you first abort the current merge activity.
}
return
}
} elseif {$commit_type ne $curType || $HEAD ne $curHEAD} {
info_popup {Last scanned state does not match repository state.
-Another Git program has modified this repository
-since the last scan. A rescan must be performed
-before another commit can be created.
+Another Git program has modified this repository since the last scan. A rescan must be performed before another commit can be created.
The rescan will be automatically started now.
}
U? {
error_popup "Unmerged files cannot be committed.
-File [short_path $path] has merge conflicts.
-You must resolve them and add the file before committing.
+File [short_path $path] has merge conflicts. You must resolve them and add the file before committing.
"
unlock_index
return
}
}
}
- if {!$files_ready} {
+ if {!$files_ready && ![string match *merge $curType]} {
info_popup {No changes to commit.
You must add at least 1 file before you can commit.
if {$tree_id eq $old_tree} {
info_popup {No changes to commit.
-No files were modified by this commit and it
-was not a merge commit.
+No files were modified by this commit and it was not a merge commit.
A rescan will be automatically started now.
}
-value head \
-variable create_branch_revtype \
-font font_ui
- eval tk_optionMenu $w.from.head_m create_branch_head $all_heads
+ set lbranchm [eval tk_optionMenu $w.from.head_m create_branch_head \
+ $all_heads]
+ $lbranchm configure -font font_ui
+ $w.from.head_m configure -font font_ui
grid $w.from.head_r $w.from.head_m -sticky w
set all_trackings [all_tracking_branches]
if {$all_trackings ne {}} {
-value tracking \
-variable create_branch_revtype \
-font font_ui
- eval tk_optionMenu $w.from.tracking_m \
+ set tbranchm [eval tk_optionMenu $w.from.tracking_m \
create_branch_trackinghead \
- $all_trackings
+ $all_trackings]
+ $tbranchm configure -font font_ui
+ $w.from.tracking_m configure -font font_ui
grid $w.from.tracking_r $w.from.tracking_m -sticky w
}
set all_tags [load_all_tags]
-value tag \
-variable create_branch_revtype \
-font font_ui
- eval tk_optionMenu $w.from.tag_m \
+ set tagsm [eval tk_optionMenu $w.from.tag_m \
create_branch_tag \
- $all_tags
+ $all_tags]
+ $tagsm configure -font font_ui
+ $w.from.tag_m configure -font font_ui
grid $w.from.tag_r $w.from.tag_m -sticky w
}
radiobutton $w.from.exp_r \
-value head \
-variable delete_branch_checktype \
-font font_ui
- eval tk_optionMenu $w.validate.head_m delete_branch_head $all_heads
+ set mergedlocalm [eval tk_optionMenu $w.validate.head_m \
+ delete_branch_head \
+ $all_heads]
+ $mergedlocalm configure -font font_ui
+ $w.validate.head_m configure -font font_ui
grid $w.validate.head_r $w.validate.head_m -sticky w
set all_trackings [all_tracking_branches]
if {$all_trackings ne {}} {
-value tracking \
-variable delete_branch_checktype \
-font font_ui
- eval tk_optionMenu $w.validate.tracking_m \
+ set mergedtrackm [eval tk_optionMenu $w.validate.tracking_m \
delete_branch_trackinghead \
- $all_trackings
+ $all_trackings]
+ $mergedtrackm configure -font font_ui
+ $w.validate.tracking_m configure -font font_ui
grid $w.validate.tracking_r $w.validate.tracking_m -sticky w
}
radiobutton $w.validate.always_r \
} elseif {$commit_type ne $curType || $HEAD ne $curHEAD} {
info_popup {Last scanned state does not match repository state.
-Another Git program has modified this repository
-since the last scan. A rescan must be performed
-before the current branch can be changed.
+Another Git program has modified this repository since the last scan. A rescan must be performed before the current branch can be changed.
The rescan will be automatically started now.
}
if {[catch {git symbolic-ref HEAD "refs/heads/$new_branch"} err]} {
error_popup "Failed to set current branch.
-This working directory is only partially switched.
-We successfully updated your files, but failed to
-update an internal Git file.
+This working directory is only partially switched. We successfully updated your files, but failed to update an internal Git file.
-This should not have occurred. [appname] will now
-close and give up.
+This should not have occurred. [appname] will now close and give up.
$err"
do_quit
frame $w.buttons
button $w.buttons.create -text Push \
-font font_ui \
+ -default active \
-command [list start_push_anywhere_action $w]
pack $w.buttons.create -side right
button $w.buttons.cancel -text {Cancel} \
-font font_ui \
+ -default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
-value remote \
-variable push_urltype \
-font font_ui
- eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes
+ set remmenu [eval tk_optionMenu $w.dest.remote_m push_remote \
+ $all_remotes]
+ $remmenu configure -font font_ui
+ $w.dest.remote_m configure -font font_ui
grid $w.dest.remote_r $w.dest.remote_m -sticky w
if {[lsearch -sorted -exact $all_remotes origin] != -1} {
set push_remote origin
set push_thin 0
set push_tags 0
- bind $w <Visibility> "grab $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.create"
bind $w <Key-Escape> "destroy $w"
+ bind $w <Key-Return> [list start_push_anywhere_action $w]
wm title $w "[appname] ([reponame]): Push"
tkwait window $w
}
if {[string match amend* $commit_type]} {
info_popup {Cannot merge while amending.
-You must finish amending this commit before
-starting any type of merge.
+You must finish amending this commit before starting any type of merge.
}
return 0
}
if {$commit_type ne $curType || $HEAD ne $curHEAD} {
info_popup {Last scanned state does not match repository state.
-Another Git program has modified this repository
-since the last scan. A rescan must be performed
-before a merge can be performed.
+Another Git program has modified this repository since the last scan. A rescan must be performed before a merge can be performed.
The rescan will be automatically started now.
}
File [short_path $path] has merge conflicts.
-You must resolve them, add the file, and commit to
-complete the current merge. Only then can you
-begin another merge.
+You must resolve them, add the file, and commit to complete the current merge. Only then can you begin another merge.
"
unlock_index
return 0
File [short_path $path] is modified.
-You should complete the current commit before
-starting a merge. Doing so will help you abort
-a failed merge, should the need arise.
+You should complete the current commit before starting a merge. Doing so will help you abort a failed merge, should the need arise.
"
unlock_index
return 0
Your merge of $revcnt branches has failed.
-There are file-level conflicts between the
-branches which must be resolved manually.
+There are file-level conflicts between the branches which must be resolved manually.
The working directory will now be reset.
-You can attempt this merge again
-by merging only one branch at a time." $w
+You can attempt this merge again by merging only one branch at a time." $w
set fd [open "| git read-tree --reset -u HEAD" r]
fconfigure $fd -blocking 0 -translation binary
if {[ask_popup "Abort $op?
-Aborting the current $op will cause
-*ALL* uncommitted changes to be lost.
+Aborting the current $op will cause *ALL* uncommitted changes to be lost.
Continue with aborting the current $op?"] eq {yes}} {
set fd [open "| git read-tree --reset -u HEAD" r]
proc blame_incremental_status {w} {
global blame_status blame_data
+ set have $blame_data($w,blame_lines)
+ set total $blame_data($w,total_lines)
+ set pdone 0
+ if {$total} {set pdone [expr {100 * $have / $total}]}
+
set blame_status($w) [format \
"Loading annotations... %i of %i lines annotated (%2i%%)" \
- $blame_data($w,blame_lines) \
- $blame_data($w,total_lines) \
- [expr {100 * $blame_data($w,blame_lines)
- / $blame_data($w,total_lines)}]]
+ $have $total $pdone]
}
proc blame_click {w w_cmit w_line w_file cur_w pos} {
if {[winfo exists $w]} {
$w.m.s conf -background green -text {Success}
$w.ok conf -state normal
+ focus $w.ok
}
} else {
if {![winfo exists $w]} {
}
$w.m.s conf -background red -text {Error: Command Failed}
$w.ok conf -state normal
+ focus $w.ok
}
array unset console_cr $w
frame $w.buttons -border 1
button $w.buttons.close -text Close \
-font font_ui \
+ -default active \
-command [list destroy $w]
button $w.buttons.gc -text {Compress Database} \
-font font_ui \
+ -default normal \
-command "destroy $w;do_gc"
pack $w.buttons.close -side right
pack $w.buttons.gc -side left
}
pack $w.stat -pady 10 -padx 10
- bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [list destroy $w]
wm title $w "[appname] ([reponame]): Database Statistics"
commit_tree
}
-proc do_credits {} {
- global gitgui_credits
-
- set w .credits_dialog
-
- toplevel $w
- wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
-
- label $w.header -text {git-gui Contributors} -font font_uibold
- pack $w.header -side top -fill x
-
- frame $w.buttons
- button $w.buttons.close -text {Close} \
- -font font_ui \
- -command [list destroy $w]
- pack $w.buttons.close -side right
- pack $w.buttons -side bottom -fill x -pady 10 -padx 10
-
- frame $w.credits
- text $w.credits.t \
- -background [$w.header cget -background] \
- -yscrollcommand [list $w.credits.sby set] \
- -width 20 \
- -height 10 \
- -wrap none \
- -borderwidth 1 \
- -relief solid \
- -padx 5 -pady 5 \
- -font font_ui
- scrollbar $w.credits.sby -command [list $w.credits.t yview]
- pack $w.credits.sby -side right -fill y
- pack $w.credits.t -fill both -expand 1
- pack $w.credits -side top -fill both -expand 1 -padx 5 -pady 5
-
- label $w.desc \
- -text "All portions are copyrighted by their respective authors
-and are distributed under the GNU General Public License." \
- -padx 5 -pady 5 \
- -justify left \
- -anchor w \
- -borderwidth 1 \
- -relief solid \
- -font font_ui
- pack $w.desc -side top -fill x -padx 5 -pady 5
-
- $w.credits.t insert end "[string trim $gitgui_credits]\n"
- $w.credits.t conf -state disabled
- $w.credits.t see 1.0
-
- bind $w <Visibility> "grab $w; focus $w"
- bind $w <Key-Escape> [list destroy $w]
- wm title $w [$w.header cget -text]
- tkwait window $w
-}
-
proc do_about {} {
global appvers copyright
global tcl_patchLevel tk_patchLevel
frame $w.buttons
button $w.buttons.close -text {Close} \
-font font_ui \
+ -default active \
-command [list destroy $w]
- button $w.buttons.credits -text {Contributors} \
- -font font_ui \
- -command do_credits
- pack $w.buttons.credits -side left
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
"
- bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> "destroy $w"
+ bind $w <Key-Return> "destroy $w"
bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
wm title $w "About [appname]"
tkwait window $w
frame $w.buttons
button $w.buttons.restore -text {Restore Defaults} \
-font font_ui \
+ -default normal \
-command do_restore_defaults
pack $w.buttons.restore -side left
button $w.buttons.save -text Save \
-font font_ui \
+ -default active \
-command [list do_save_config $w]
pack $w.buttons.save -side right
button $w.buttons.cancel -text {Cancel} \
-font font_ui \
+ -default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
frame $w.global.$name
label $w.global.$name.l -text "$text:" -font font_ui
pack $w.global.$name.l -side left -anchor w -fill x
- eval tk_optionMenu $w.global.$name.family \
+ set fontmenu [eval tk_optionMenu $w.global.$name.family \
global_config_new(gui.$font^^family) \
- $all_fonts
+ $all_fonts]
+ $w.global.$name.family configure -font font_ui
+ $fontmenu configure -font font_ui
spinbox $w.global.$name.size \
-textvariable global_config_new(gui.$font^^size) \
-from 2 -to 80 -increment 1 \
pack $w.global.$name -side top -anchor w -fill x
}
- bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.save"
bind $w <Key-Escape> "destroy $w"
+ bind $w <Key-Return> [list do_save_config $w]
wm title $w "[appname] ([reponame]): Options"
tkwait window $w
}
enable_option transport
switch -- $subcommand {
---version -
-version -
browser -
blame {
disable_option multicommit
# -- Menu Bar
#
menu .mbar -tearoff 0
-.mbar add cascade -label Repository -menu .mbar.repository
-.mbar add cascade -label Edit -menu .mbar.edit
+.mbar add cascade -label Repository -menu .mbar.repository -font font_ui
+.mbar add cascade -label Edit -menu .mbar.edit -font font_ui
if {[is_enabled branch]} {
- .mbar add cascade -label Branch -menu .mbar.branch
+ .mbar add cascade -label Branch -menu .mbar.branch -font font_ui
}
if {[is_enabled multicommit] || [is_enabled singlecommit]} {
- .mbar add cascade -label Commit -menu .mbar.commit
+ .mbar add cascade -label Commit -menu .mbar.commit -font font_ui
}
if {[is_enabled transport]} {
- .mbar add cascade -label Merge -menu .mbar.merge
- .mbar add cascade -label Fetch -menu .mbar.fetch
- .mbar add cascade -label Push -menu .mbar.push
+ .mbar add cascade -label Merge -menu .mbar.merge -font font_ui
+ .mbar add cascade -label Fetch -menu .mbar.fetch -font font_ui
+ .mbar add cascade -label Push -menu .mbar.push -font font_ui
}
. configure -menu .mbar
# -- Help Menu
#
-.mbar add cascade -label Help -menu .mbar.help
+.mbar add cascade -label Help -menu .mbar.help -font font_ui
menu .mbar.help
if {![is_MacOSX]} {
# -- Not a normal commit type invocation? Do that instead!
#
switch -- $subcommand {
---version -
-version {
- puts "git-gui version $appvers"
- exit
-}
browser {
if {[llength $argv] != 1} {
puts stderr "usage: $argv0 browser commit"
set file_lists($ui_index) [list]
set file_lists($ui_workdir) [list]
-wm title . "[appname] ([file normalize [file dirname [gitdir]]])"
+wm title . "[appname] ([reponame]) [file normalize [file dirname [gitdir]]]"
focus -force $ui_comm
# -- Warn the user about environmental problems. Cygwin's Tcl
if {[ask_popup \
"This repository currently has $objects_current loose objects.
-To maintain optimal performance it is strongly
-recommended that you compress the database
-when more than $object_limit loose objects exist.
+To maintain optimal performance it is strongly recommended that you compress the database when more than $object_limit loose objects exist.
Compress the database now?"] eq yes} {
do_gc