diff options
Diffstat (limited to 'git-gui')
29 files changed, 6435 insertions, 3240 deletions
diff --git a/git-gui/GIT-VERSION-GEN b/git-gui/GIT-VERSION-GEN index a88b6824b9..92373d251a 100755 --- a/git-gui/GIT-VERSION-GEN +++ b/git-gui/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=0.20.GITGUI +DEF_VER=0.21.GITGUI LF=' ' diff --git a/git-gui/Makefile b/git-gui/Makefile index 4f00bdd3d6..fe30be38dc 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -259,7 +259,7 @@ lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS rm -f $@ ; \ echo '# Autogenerated by git-gui Makefile' >$@ && \ echo >>$@ && \ - $(foreach p,$(PRELOAD_FILES) $(ALL_LIBFILES),echo '$(subst lib/,,$p)' >>$@ &&) \ + $(foreach p,$(PRELOAD_FILES) $(sort $(ALL_LIBFILES)),echo '$(subst lib/,,$p)' >>$@ &&) \ echo >>$@ ; \ fi diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 11048c7a0e..5bc21b878d 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -275,6 +275,10 @@ proc is_Cygwin {} { set _iscygwin 0 } else { set _iscygwin 1 + # Handle MSys2 which is only cygwin when MSYSTEM is MSYS. + if {[info exists ::env(MSYSTEM)] && $::env(MSYSTEM) ne "MSYS"} { + set _iscygwin 0 + } } } else { set _iscygwin 0 @@ -530,28 +534,10 @@ proc _lappend_nice {cmd_var} { } proc git {args} { - set opt [list] - - while {1} { - switch -- [lindex $args 0] { - --nice { - _lappend_nice opt - } - - default { - break - } - - } - - set args [lrange $args 1 end] - } - - set cmdp [_git_cmd [lindex $args 0]] - set args [lrange $args 1 end] - - _trace_exec [concat $opt $cmdp $args] - set result [eval exec $opt $cmdp $args] + set fd [eval [list git_read] $args] + fconfigure $fd -translation binary -encoding utf-8 + set result [string trimright [read $fd] "\n"] + close $fd if {$::_trace} { puts stderr "< $result" } @@ -1107,7 +1093,7 @@ git-version proc _parse_config {arr_name args} { [list git_read config] \ $args \ [list --null --list]] - fconfigure $fd_rc -translation binary + fconfigure $fd_rc -translation binary -encoding utf-8 set buf [read $fd_rc] close $fd_rc } @@ -1616,11 +1602,13 @@ proc run_prepare_commit_msg_hook {} { if {[file isfile [gitdir MERGE_MSG]]} { set pcm_source "merge" set fd_mm [open [gitdir MERGE_MSG] r] + fconfigure $fd_mm -encoding utf-8 puts -nonewline $fd_pcm [read $fd_mm] close $fd_mm } elseif {[file isfile [gitdir SQUASH_MSG]]} { set pcm_source "squash" set fd_sm [open [gitdir SQUASH_MSG] r] + fconfigure $fd_sm -encoding utf-8 puts -nonewline $fd_pcm [read $fd_sm] close $fd_sm } else { @@ -1685,7 +1673,7 @@ proc read_diff_index {fd after} { set i [split [string range $buf_rdi $c [expr {$z1 - 2}]] { }] set p [string range $buf_rdi $z1 [expr {$z2 - 1}]] merge_state \ - [encoding convertfrom $p] \ + [encoding convertfrom utf-8 $p] \ [lindex $i 4]? \ [list [lindex $i 0] [lindex $i 2]] \ [list] @@ -1718,7 +1706,7 @@ proc read_diff_files {fd after} { set i [split [string range $buf_rdf $c [expr {$z1 - 2}]] { }] set p [string range $buf_rdf $z1 [expr {$z2 - 1}]] merge_state \ - [encoding convertfrom $p] \ + [encoding convertfrom utf-8 $p] \ ?[lindex $i 4] \ [list] \ [list [lindex $i 0] [lindex $i 2]] @@ -1741,7 +1729,7 @@ proc read_ls_others {fd after} { set pck [split $buf_rlo "\0"] set buf_rlo [lindex $pck end] foreach p [lrange $pck 0 end-1] { - set p [encoding convertfrom $p] + set p [encoding convertfrom utf-8 $p] if {[string index $p end] eq {/}} { set p [string range $p 0 end-1] } @@ -2505,13 +2493,28 @@ proc force_first_diff {after} { } } -proc toggle_or_diff {w x y} { +proc toggle_or_diff {mode w args} { global file_states file_lists current_diff_path ui_index ui_workdir global last_clicked selected_paths - set pos [split [$w index @$x,$y] .] - set lno [lindex $pos 0] - set col [lindex $pos 1] + if {$mode eq "click"} { + foreach {x y} $args break + set pos [split [$w index @$x,$y] .] + foreach {lno col} $pos break + } else { + if {$last_clicked ne {}} { + set lno [lindex $last_clicked 1] + } else { + set lno [expr {int([lindex [$w tag ranges in_diff] 0])}] + } + if {$mode eq "toggle"} { + set col 0; set y 2 + } else { + incr lno [expr {$mode eq "up" ? -1 : 1}] + set col 1 + } + } + set path [lindex $file_lists($w) [expr {$lno - 1}]] if {$path eq {}} { set last_clicked {} @@ -2519,6 +2522,7 @@ proc toggle_or_diff {w x y} { } set last_clicked [list $w $lno] + focus $w array unset selected_paths $ui_index tag remove in_sel 0.0 end $ui_workdir tag remove in_sel 0.0 end @@ -2598,7 +2602,7 @@ proc add_range_to_selection {w x y} { global file_lists last_clicked selected_paths if {[lindex $last_clicked 0] ne $w} { - toggle_or_diff $w $x $y + toggle_or_diff click $w $x $y return } @@ -3007,7 +3011,7 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]} set subcommand_args {} proc usage {} { - set s "usage: $::argv0 $::subcommand $::subcommand_args" + set s "[mc usage:] $::argv0 $::subcommand $::subcommand_args" if {[tk windowingsystem] eq "win32"} { wm withdraw . tk_messageBox -icon info -message $s \ @@ -3139,7 +3143,7 @@ gui { # fall through to setup UI for commits } default { - set err "usage: $argv0 \[{blame|browser|citool}\]" + set err "[mc usage:] $argv0 \[{blame|browser|citool}\]" if {[tk windowingsystem] eq "win32"} { wm withdraw . tk_messageBox -icon error -message $err \ @@ -3178,16 +3182,38 @@ if {$use_ttk} { } pack .vpane -anchor n -side top -fill both -expand 1 +# -- Working Directory File List + +textframe .vpane.files.workdir -height 100 -width 200 +tlabel .vpane.files.workdir.title -text [mc "Unstaged Changes"] \ + -background lightsalmon -foreground black +ttext $ui_workdir -background white -foreground black \ + -borderwidth 0 \ + -width 20 -height 10 \ + -wrap none \ + -takefocus 1 -highlightthickness 1\ + -cursor $cursor_ptr \ + -xscrollcommand {.vpane.files.workdir.sx set} \ + -yscrollcommand {.vpane.files.workdir.sy set} \ + -state disabled +${NS}::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview] +${NS}::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview] +pack .vpane.files.workdir.title -side top -fill x +pack .vpane.files.workdir.sx -side bottom -fill x +pack .vpane.files.workdir.sy -side right -fill y +pack $ui_workdir -side left -fill both -expand 1 + # -- Index File List # -${NS}::frame .vpane.files.index -height 100 -width 200 +textframe .vpane.files.index -height 100 -width 200 tlabel .vpane.files.index.title \ -text [mc "Staged Changes (Will Commit)"] \ -background lightgreen -foreground black -text $ui_index -background white -foreground black \ +ttext $ui_index -background white -foreground black \ -borderwidth 0 \ -width 20 -height 10 \ -wrap none \ + -takefocus 1 -highlightthickness 1\ -cursor $cursor_ptr \ -xscrollcommand {.vpane.files.index.sx set} \ -yscrollcommand {.vpane.files.index.sy set} \ @@ -3199,26 +3225,8 @@ pack .vpane.files.index.sx -side bottom -fill x pack .vpane.files.index.sy -side right -fill y pack $ui_index -side left -fill both -expand 1 -# -- Working Directory File List +# -- Insert the workdir and index into the panes # -${NS}::frame .vpane.files.workdir -height 100 -width 200 -tlabel .vpane.files.workdir.title -text [mc "Unstaged Changes"] \ - -background lightsalmon -foreground black -text $ui_workdir -background white -foreground black \ - -borderwidth 0 \ - -width 20 -height 10 \ - -wrap none \ - -cursor $cursor_ptr \ - -xscrollcommand {.vpane.files.workdir.sx set} \ - -yscrollcommand {.vpane.files.workdir.sy set} \ - -state disabled -${NS}::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview] -${NS}::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview] -pack .vpane.files.workdir.title -side top -fill x -pack .vpane.files.workdir.sx -side bottom -fill x -pack .vpane.files.workdir.sy -side right -fill y -pack $ui_workdir -side left -fill both -expand 1 - .vpane.files add .vpane.files.workdir .vpane.files add .vpane.files.index if {!$use_ttk} { @@ -3301,7 +3309,7 @@ if {![is_enabled nocommit]} { # ${NS}::frame .vpane.lower.commarea.buffer ${NS}::frame .vpane.lower.commarea.buffer.header -set ui_comm .vpane.lower.commarea.buffer.t +set ui_comm .vpane.lower.commarea.buffer.frame.t set ui_coml .vpane.lower.commarea.buffer.header.l if {![is_enabled nocommit]} { @@ -3344,20 +3352,25 @@ if {![is_enabled nocommit]} { pack .vpane.lower.commarea.buffer.header.new -side right } -text $ui_comm -background white -foreground black \ +textframe .vpane.lower.commarea.buffer.frame +ttext $ui_comm -background white -foreground black \ -borderwidth 1 \ -undo true \ -maxundo 20 \ -autoseparators true \ + -takefocus 1 \ + -highlightthickness 1 \ -relief sunken \ -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \ -font font_diff \ - -yscrollcommand {.vpane.lower.commarea.buffer.sby set} -${NS}::scrollbar .vpane.lower.commarea.buffer.sby \ + -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} +${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \ -command [list $ui_comm yview] -pack .vpane.lower.commarea.buffer.header -side top -fill x -pack .vpane.lower.commarea.buffer.sby -side right -fill y + +pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y pack $ui_comm -side left -fill y +pack .vpane.lower.commarea.buffer.header -side top -fill x +pack .vpane.lower.commarea.buffer.frame -side left -fill y pack .vpane.lower.commarea.buffer -side left -fill y # -- Commit Message Buffer Context Menu @@ -3455,12 +3468,13 @@ bind_button3 .vpane.lower.diff.header.path "tk_popup $ctxm %X %Y" # -- Diff Body # -${NS}::frame .vpane.lower.diff.body +textframe .vpane.lower.diff.body set ui_diff .vpane.lower.diff.body.t -text $ui_diff -background white -foreground black \ +ttext $ui_diff -background white -foreground black \ -borderwidth 0 \ -width 80 -height 5 -wrap none \ -font font_diff \ + -takefocus 1 -highlightthickness 1 \ -xscrollcommand {.vpane.lower.diff.body.sbx set} \ -yscrollcommand {.vpane.lower.diff.body.sby set} \ -state disabled @@ -3815,10 +3829,10 @@ bind . <$M1B-Key-r> ui_do_rescan bind . <$M1B-Key-R> ui_do_rescan bind . <$M1B-Key-s> do_signoff bind . <$M1B-Key-S> do_signoff -bind . <$M1B-Key-t> do_add_selection -bind . <$M1B-Key-T> do_add_selection -bind . <$M1B-Key-u> do_unstage_selection -bind . <$M1B-Key-U> do_unstage_selection +bind . <$M1B-Key-t> { toggle_or_diff toggle %W } +bind . <$M1B-Key-T> { toggle_or_diff toggle %W } +bind . <$M1B-Key-u> { toggle_or_diff toggle %W } +bind . <$M1B-Key-U> { toggle_or_diff toggle %W } bind . <$M1B-Key-j> do_revert_selection bind . <$M1B-Key-J> do_revert_selection bind . <$M1B-Key-i> do_add_all @@ -3830,9 +3844,11 @@ bind . <$M1B-Key-plus> {show_more_context;break} bind . <$M1B-Key-KP_Add> {show_more_context;break} bind . <$M1B-Key-Return> do_commit foreach i [list $ui_index $ui_workdir] { - bind $i <Button-1> "toggle_or_diff $i %x %y; break" - bind $i <$M1B-Button-1> "add_one_to_selection $i %x %y; break" - bind $i <Shift-Button-1> "add_range_to_selection $i %x %y; break" + bind $i <Button-1> { toggle_or_diff click %W %x %y; break } + bind $i <$M1B-Button-1> { add_one_to_selection %W %x %y; break } + bind $i <Shift-Button-1> { add_range_to_selection %W %x %y; break } + bind $i <Key-Up> { toggle_or_diff up %W; break } + bind $i <Key-Down> { toggle_or_diff down %W; break } } unset i diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl index b1d15f4621..a1aeb8b96e 100644 --- a/git-gui/lib/blame.tcl +++ b/git-gui/lib/blame.tcl @@ -70,7 +70,7 @@ constructor new {i_commit i_path i_jump} { set path $i_path make_toplevel top w - wm title $top [append "[appname] ([reponame]): " [mc "File Viewer"]] + wm title $top [mc "%s (%s): File Viewer" [appname] [reponame]] set font_w [font measure font_diff "0"] diff --git a/git-gui/lib/branch_checkout.tcl b/git-gui/lib/branch_checkout.tcl index 2e459a8297..d06037decc 100644 --- a/git-gui/lib/branch_checkout.tcl +++ b/git-gui/lib/branch_checkout.tcl @@ -13,7 +13,7 @@ constructor dialog {} { global use_ttk NS make_dialog top w wm withdraw $w - wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]] + wm title $top [mc "%s (%s): Checkout Branch" [appname] [reponame]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" } diff --git a/git-gui/lib/branch_create.tcl b/git-gui/lib/branch_create.tcl index 4bb907705c..ba367d551d 100644 --- a/git-gui/lib/branch_create.tcl +++ b/git-gui/lib/branch_create.tcl @@ -20,7 +20,7 @@ constructor dialog {} { make_dialog top w wm withdraw $w - wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]] + wm title $top [mc "%s (%s): Create Branch" [appname] [reponame]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" } diff --git a/git-gui/lib/branch_delete.tcl b/git-gui/lib/branch_delete.tcl index 867938ec6a..a5051637bb 100644 --- a/git-gui/lib/branch_delete.tcl +++ b/git-gui/lib/branch_delete.tcl @@ -13,7 +13,7 @@ constructor dialog {} { make_dialog top w wm withdraw $w - wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]] + wm title $top [mc "%s (%s): Delete Branch" [appname] [reponame]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" } @@ -128,7 +128,7 @@ method _delete {} { set b [lindex $i 0] set o [lindex $i 1] if {[catch {git branch -D $b} err]} { - append failed " - $b: $err\n" + append failed [mc " - %s:" $b] " $err\n" } } diff --git a/git-gui/lib/branch_rename.tcl b/git-gui/lib/branch_rename.tcl index 6e510ec2e3..3a2d79a9cc 100644 --- a/git-gui/lib/branch_rename.tcl +++ b/git-gui/lib/branch_rename.tcl @@ -12,7 +12,7 @@ constructor dialog {} { make_dialog top w wm withdraw $w - wm title $top [append "[appname] ([reponame]): " [mc "Rename Branch"]] + wm title $top [mc "%s (%s): Rename Branch" [appname] [reponame]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" } diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl index 0328338fda..a982983667 100644 --- a/git-gui/lib/browser.tcl +++ b/git-gui/lib/browser.tcl @@ -24,7 +24,7 @@ constructor new {commit {path {}}} { global cursor_ptr M1B use_ttk NS make_dialog top w wm withdraw $top - wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]] + wm title $top [mc "%s (%s): File Browser" [appname] [reponame]] if {$path ne {}} { if {[string index $path end] ne {/}} { @@ -197,7 +197,7 @@ method _ls {tree_id {name {}}} { $w conf -state disabled set fd [git_read ls-tree -z $tree_id] - fconfigure $fd -blocking 0 -translation binary -encoding binary + fconfigure $fd -blocking 0 -translation binary -encoding utf-8 fileevent $fd readable [cb _read $fd] } @@ -272,7 +272,7 @@ constructor dialog {} { global use_ttk NS make_dialog top w wm withdraw $top - wm title $top [append "[appname] ([reponame]): " [mc "Browse Branch Files"]] + wm title $top [mc "%s (%s): Browse Branch Files" [appname] [reponame]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" wm transient $top . diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 864b687057..83620b7cbc 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -2,7 +2,7 @@ # Copyright (C) 2006, 2007 Shawn Pearce proc load_last_commit {} { - global HEAD PARENT MERGE_HEAD commit_type ui_comm + global HEAD PARENT MERGE_HEAD commit_type ui_comm commit_author global repo_config if {[llength $PARENT] == 0} { @@ -34,6 +34,8 @@ You are currently in the middle of a merge that has not been fully completed. Y lappend parents [string range $line 7 end] } elseif {[string match {encoding *} $line]} { set enc [string tolower [string range $line 9 end]] + } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { + set commit_author [list name $name email $email date $time] } } set msg [read $fd] @@ -106,9 +108,10 @@ proc do_signoff {} { } proc create_new_commit {} { - global commit_type ui_comm + global commit_type ui_comm commit_author set commit_type normal + unset -nocomplain commit_author $ui_comm delete 0.0 end $ui_comm edit reset $ui_comm edit modified false @@ -322,11 +325,12 @@ proc commit_writetree {curHEAD msg_p} { } proc commit_committree {fd_wt curHEAD msg_p} { - global HEAD PARENT MERGE_HEAD commit_type + global HEAD PARENT MERGE_HEAD commit_type commit_author global current_branch global ui_comm selected_commit_type global file_states selected_paths rescan_active global repo_config + global env gets $fd_wt tree_id if {[catch {close $fd_wt} err]} { @@ -366,9 +370,15 @@ A rescan will be automatically started now. } } + if {[info exists commit_author]} { + set old_author [commit_author_ident $commit_author] + } # -- Create the commit. # set cmd [list commit-tree $tree_id] + if {[is_config_true commit.gpgsign]} { + lappend cmd -S + } foreach p [concat $PARENT $MERGE_HEAD] { lappend cmd -p $p } @@ -378,8 +388,14 @@ A rescan will be automatically started now. error_popup [strcat [mc "commit-tree failed:"] "\n\n$err"] ui_status [mc "Commit failed."] unlock_index + unset -nocomplain commit_author + commit_author_reset $old_author return } + if {[info exists commit_author]} { + unset -nocomplain commit_author + commit_author_reset $old_author + } # -- Update the HEAD ref. # @@ -506,3 +522,20 @@ proc commit_postcommit_wait {fd_ph cmt_id} { } fconfigure $fd_ph -blocking 0 } + +proc commit_author_ident {details} { + global env + array set author $details + set old [array get env GIT_AUTHOR_*] + set env(GIT_AUTHOR_NAME) $author(name) + set env(GIT_AUTHOR_EMAIL) $author(email) + set env(GIT_AUTHOR_DATE) $author(date) + return $old +} +proc commit_author_reset {details} { + global env + unset env(GIT_AUTHOR_NAME) env(GIT_AUTHOR_EMAIL) env(GIT_AUTHOR_DATE) + if {$details ne {}} { + array set env $details + } +} diff --git a/git-gui/lib/database.tcl b/git-gui/lib/database.tcl index 1f187ed286..85783081e0 100644 --- a/git-gui/lib/database.tcl +++ b/git-gui/lib/database.tcl @@ -54,7 +54,7 @@ proc do_stats {} { set value "$value[lindex $s 2]" } - ${NS}::label $w.stat.l_$name -text "$label:" -anchor w + ${NS}::label $w.stat.l_$name -text [mc "%s:" $label] -anchor w ${NS}::label $w.stat.v_$name -text $value -anchor w grid $w.stat.l_$name $w.stat.v_$name -sticky we -padx {0 5} } @@ -63,7 +63,7 @@ proc do_stats {} { 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 [append "[appname] ([reponame]): " [mc "Database Statistics"]] + wm title $w [mc "%s (%s): Database Statistics" [appname] [reponame]] wm deiconify $w tkwait window $w } diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl index 0d56986215..4cae10a4c7 100644 --- a/git-gui/lib/diff.tcl +++ b/git-gui/lib/diff.tcl @@ -127,6 +127,9 @@ proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} { } else { start_show_diff $cont_info } + + global current_diff_path selected_paths + set selected_paths($current_diff_path) 1 } proc show_unmerged_diff {cont_info} { @@ -220,10 +223,9 @@ proc show_other_diff {path w m cont_info} { } $ui_diff conf -state normal if {$type eq {submodule}} { - $ui_diff insert end [append \ - "* " \ - [mc "Git Repository (subproject)"] \ - "\n"] d_info + $ui_diff insert end \ + "* [mc "Git Repository (subproject)"]\n" \ + d_info } elseif {![catch {set type [exec file $path]}]} { set n [string length $path] if {[string equal -length $n $path $type]} { @@ -608,7 +610,7 @@ proc apply_hunk {x y} { puts -nonewline $p $current_diff_header puts -nonewline $p [$ui_diff get $s_lno $e_lno] close $p} err]} { - error_popup [append $failed_msg "\n\n$err"] + error_popup "$failed_msg\n\n$err" unlock_index return } @@ -826,7 +828,7 @@ proc apply_range_or_line {x y} { puts -nonewline $p $current_diff_header puts -nonewline $p $wholepatch close $p} err]} { - error_popup [append $failed_msg "\n\n$err"] + error_popup "$failed_msg\n\n$err" } unlock_index diff --git a/git-gui/lib/error.tcl b/git-gui/lib/error.tcl index c0fa69af56..8968a57f33 100644 --- a/git-gui/lib/error.tcl +++ b/git-gui/lib/error.tcl @@ -17,7 +17,7 @@ proc error_popup {msg} { set cmd [list tk_messageBox \ -icon error \ -type ok \ - -title [append "$title: " [mc "error"]] \ + -title [mc "%s: error" $title] \ -message $msg] if {[winfo ismapped [_error_parent]]} { lappend cmd -parent [_error_parent] @@ -33,7 +33,7 @@ proc warn_popup {msg} { set cmd [list tk_messageBox \ -icon warning \ -type ok \ - -title [append "$title: " [mc "warning"]] \ + -title [mc "%s: warning" $title] \ -message $msg] if {[winfo ismapped [_error_parent]]} { lappend cmd -parent [_error_parent] @@ -77,7 +77,7 @@ proc hook_failed_popup {hook msg {is_fatal 1}} { wm withdraw $w ${NS}::frame $w.m - ${NS}::label $w.m.l1 -text "$hook hook failed:" \ + ${NS}::label $w.m.l1 -text [mc "%s hook failed:" $hook] \ -anchor w \ -justify left \ -font font_uibold @@ -113,7 +113,7 @@ proc hook_failed_popup {hook msg {is_fatal 1}} { bind $w <Visibility> "grab $w; focus $w" bind $w <Key-Return> "destroy $w" - wm title $w [strcat "[appname] ([reponame]): " [mc "error"]] + wm title $w [mc "%s (%s): error" [appname] [reponame]] wm deiconify $w tkwait window $w } diff --git a/git-gui/lib/index.tcl b/git-gui/lib/index.tcl index 74a81a7b42..b588db11d9 100644 --- a/git-gui/lib/index.tcl +++ b/git-gui/lib/index.tcl @@ -115,7 +115,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} { set info [lindex $s 2] if {$info eq {}} continue - puts -nonewline $fd "$info\t[encoding convertto $path]\0" + puts -nonewline $fd "$info\t[encoding convertto utf-8 $path]\0" display_file $path $new } @@ -186,7 +186,7 @@ proc write_update_index {fd pathList totalCnt batch after} { ?M {set new M_} ?? {continue} } - puts -nonewline $fd "[encoding convertto $path]\0" + puts -nonewline $fd "[encoding convertto utf-8 $path]\0" display_file $path $new } @@ -247,7 +247,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} { ?M - ?T - ?D { - puts -nonewline $fd "[encoding convertto $path]\0" + puts -nonewline $fd "[encoding convertto utf-8 $path]\0" display_file $path ?_ } } @@ -291,7 +291,7 @@ proc do_unstage_selection {} { if {[array size selected_paths] > 0} { unstage_helper \ - {Unstaging selected files from commit} \ + [mc "Unstaging selected files from commit"] \ [array names selected_paths] } elseif {$current_diff_path ne {}} { unstage_helper \ @@ -343,7 +343,7 @@ proc do_add_selection {} { if {[array size selected_paths] > 0} { add_helper \ - {Adding selected files} \ + [mc "Adding selected files"] \ [array names selected_paths] } elseif {$current_diff_path ne {}} { add_helper \ @@ -385,7 +385,7 @@ proc do_add_all {} { set paths [concat $paths $untracked_paths] } } - add_helper {Adding all changed files} $paths + add_helper [mc "Adding all changed files"] $paths } proc revert_helper {txt paths} { diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl index 460d32fa22..9f253db5b3 100644 --- a/git-gui/lib/merge.tcl +++ b/git-gui/lib/merge.tcl @@ -112,12 +112,16 @@ method _start {} { close $fh set _last_merged_branch $branch - set cmd [list git] - lappend cmd merge - lappend cmd --strategy=recursive - lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]] - lappend cmd HEAD - lappend cmd $name + if {[git-version >= "2.5.0"]} { + set cmd [list git merge --strategy=recursive FETCH_HEAD] + } else { + set cmd [list git] + lappend cmd merge + lappend cmd --strategy=recursive + lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]] + lappend cmd HEAD + lappend cmd $name + } ui_status [mc "Merging %s and %s..." $current_branch $stitle] set cons [console::new [mc "Merge"] "merge $stitle"] @@ -149,7 +153,7 @@ constructor dialog {} { } make_dialog top w - wm title $top [append "[appname] ([reponame]): " [mc "Merge"]] + wm title $top [mc "%s (%s): Merge" [appname] [reponame]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" } diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl index b5b6b2fea6..e43971bfa3 100644 --- a/git-gui/lib/option.tcl +++ b/git-gui/lib/option.tcl @@ -179,7 +179,7 @@ proc do_options {} { i-* { regexp -- {-(\d+)\.\.(\d+)$} $type _junk min max ${NS}::frame $w.$f.$optid - ${NS}::label $w.$f.$optid.l -text "$text:" + ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text] pack $w.$f.$optid.l -side left -anchor w -fill x tspinbox $w.$f.$optid.v \ -textvariable ${f}_config_new($name) \ @@ -194,7 +194,7 @@ proc do_options {} { c - t { ${NS}::frame $w.$f.$optid - ${NS}::label $w.$f.$optid.l -text "$text:" + ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text] ${NS}::entry $w.$f.$optid.v \ -width 20 \ -textvariable ${f}_config_new($name) @@ -217,7 +217,7 @@ proc do_options {} { s { set opts [eval [lindex $option 3]] ${NS}::frame $w.$f.$optid - ${NS}::label $w.$f.$optid.l -text "$text:" + ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text] if {$use_ttk} { ttk::combobox $w.$f.$optid.v \ -textvariable ${f}_config_new($name) \ @@ -279,7 +279,7 @@ proc do_options {} { [font configure $font -size] ${NS}::frame $w.global.$name - ${NS}::label $w.global.$name.l -text "$text:" + ${NS}::label $w.global.$name.l -text [mc "%s:" $text] ${NS}::button $w.global.$name.b \ -text [mc "Change Font"] \ -command [list \ diff --git a/git-gui/lib/remote.tcl b/git-gui/lib/remote.tcl index 4e5c784418..ef77ed7399 100644 --- a/git-gui/lib/remote.tcl +++ b/git-gui/lib/remote.tc |