diff options
Diffstat (limited to 'git-gui')
-rw-r--r-- | git-gui/.gitattributes | 3 | ||||
-rw-r--r-- | git-gui/Makefile | 2 | ||||
-rwxr-xr-x | git-gui/git-gui--askpass | 59 | ||||
-rwxr-xr-x | git-gui/git-gui.sh | 766 | ||||
-rw-r--r-- | git-gui/lib/blame.tcl | 300 | ||||
-rw-r--r-- | git-gui/lib/browser.tcl | 2 | ||||
-rw-r--r-- | git-gui/lib/choose_repository.tcl | 22 | ||||
-rw-r--r-- | git-gui/lib/commit.tcl | 11 | ||||
-rw-r--r-- | git-gui/lib/diff.tcl | 186 | ||||
-rw-r--r-- | git-gui/lib/encoding.tcl | 250 | ||||
-rw-r--r-- | git-gui/lib/index.tcl | 21 | ||||
-rw-r--r-- | git-gui/lib/merge.tcl | 1 | ||||
-rw-r--r-- | git-gui/lib/mergetool.tcl | 393 | ||||
-rw-r--r-- | git-gui/lib/option.tcl | 49 | ||||
-rw-r--r-- | git-gui/lib/remote.tcl | 188 | ||||
-rw-r--r-- | git-gui/lib/remote_add.tcl | 191 | ||||
-rw-r--r-- | git-gui/lib/remote_branch_delete.tcl | 6 | ||||
-rw-r--r-- | git-gui/lib/search.tcl | 198 | ||||
-rw-r--r-- | git-gui/lib/spellcheck.tcl | 1 | ||||
-rw-r--r-- | git-gui/lib/sshkey.tcl | 126 | ||||
-rw-r--r-- | git-gui/lib/tools.tcl | 159 | ||||
-rw-r--r-- | git-gui/lib/tools_dlg.tcl | 421 | ||||
-rw-r--r-- | git-gui/lib/transport.tcl | 2 | ||||
-rw-r--r-- | git-gui/po/de.po | 442 | ||||
-rw-r--r-- | git-gui/po/git-gui.pot | 1076 |
25 files changed, 4184 insertions, 691 deletions
diff --git a/git-gui/.gitattributes b/git-gui/.gitattributes new file mode 100644 index 000000000..f96112d47 --- /dev/null +++ b/git-gui/.gitattributes @@ -0,0 +1,3 @@ +* encoding=US-ASCII +git-gui.sh encoding=UTF-8 +/po/*.po encoding=UTF-8 diff --git a/git-gui/Makefile b/git-gui/Makefile index 55765c8a3..3ad8a21b3 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -285,6 +285,7 @@ all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES) install: all $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1) $(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)' + $(QUIET)$(INSTALL_X0)git-gui--askpass $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)' $(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true ifdef GITGUI_WINDOWS_WRAPPER $(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)' @@ -302,6 +303,7 @@ endif uninstall: $(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)' $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1) + $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askpass $(REMOVE_F1) $(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true ifdef GITGUI_WINDOWS_WRAPPER $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1) diff --git a/git-gui/git-gui--askpass b/git-gui/git-gui--askpass new file mode 100755 index 000000000..12e117ecb --- /dev/null +++ b/git-gui/git-gui--askpass @@ -0,0 +1,59 @@ +#!/bin/sh +# Tcl ignores the next line -*- tcl -*- \ +exec wish "$0" -- "$@" + +# This is a trivial implementation of an SSH_ASKPASS handler. +# Git-gui uses this script if none are already configured. + +set answer {} +set yesno 0 +set rc 255 + +if {$argc < 1} { + set prompt "Enter your OpenSSH passphrase:" +} else { + set prompt [join $argv " "] + if {[regexp -nocase {\(yes\/no\)\?\s*$} $prompt]} { + set yesno 1 + } +} + +message .m -text $prompt -justify center -aspect 4000 +pack .m -side top -fill x -padx 20 -pady 20 -expand 1 + +entry .e -textvariable answer -width 50 +pack .e -side top -fill x -padx 10 -pady 10 + +if {!$yesno} { + .e configure -show "*" +} + +frame .b +button .b.ok -text OK -command finish +button .b.cancel -text Cancel -command {destroy .} + +pack .b.ok -side left -expand 1 +pack .b.cancel -side right -expand 1 +pack .b -side bottom -fill x -padx 10 -pady 10 + +bind . <Visibility> {focus -force .e} +bind . <Key-Return> finish +bind . <Key-Escape> {destroy .} +bind . <Destroy> {exit $rc} + +proc finish {} { + if {$::yesno} { + if {$::answer ne "yes" && $::answer ne "no"} { + tk_messageBox -icon error -title "Error" -type ok \ + -message "Only 'yes' or 'no' input allowed." + return + } + } + + set ::rc 0 + puts $::answer + destroy . +} + +wm title . "OpenSSH" +tk::PlaceWindow . diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 86402d49f..8a4b42dbd 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -521,6 +521,19 @@ proc kill_file_process {fd} { } } +proc gitattr {path attr default} { + if {[catch {set r [git check-attr $attr -- $path]}]} { + set r unspecified + } else { + set r [join [lrange [split $r :] 2 end] :] + regsub {^ } $r {} r + } + if {$r eq {unspecified}} { + return $default + } + return $r +} + proc sq {value} { regsub -all ' $value "'\\''" value return "'$value'" @@ -578,6 +591,34 @@ bind . <Visibility> { if {[is_Windows]} { wm iconbitmap . -default $oguilib/git-gui.ico + set ::tk::AlwaysShowSelection 1 + + # Spoof an X11 display for SSH + if {![info exists env(DISPLAY)]} { + set env(DISPLAY) :9999 + } +} else { + catch { + image create photo gitlogo -width 16 -height 16 + + gitlogo put #33CC33 -to 7 0 9 2 + gitlogo put #33CC33 -to 4 2 12 4 + gitlogo put #33CC33 -to 7 4 9 6 + gitlogo put #CC3333 -to 4 6 12 8 + gitlogo put gray26 -to 4 9 6 10 + gitlogo put gray26 -to 3 10 6 12 + gitlogo put gray26 -to 8 9 13 11 + gitlogo put gray26 -to 8 11 10 12 + gitlogo put gray26 -to 11 11 13 14 + gitlogo put gray26 -to 3 12 5 14 + gitlogo put gray26 -to 5 13 + gitlogo put gray26 -to 10 13 + gitlogo put gray26 -to 4 14 12 15 + gitlogo put gray26 -to 5 15 11 16 + gitlogo redither + + wm iconphoto . -default gitlogo + } } ###################################################################### @@ -657,17 +698,21 @@ proc apply_config {} { } set default_config(branch.autosetupmerge) true +set default_config(merge.tool) {} +set default_config(merge.keepbackup) true set default_config(merge.diffstat) true set default_config(merge.summary) false set default_config(merge.verbosity) 2 set default_config(user.name) {} set default_config(user.email) {} +set default_config(gui.encoding) [encoding system] set default_config(gui.matchtrackingbranch) false set default_config(gui.pruneduringfetch) false set default_config(gui.trustmtime) false set default_config(gui.fastcopyblame) false set default_config(gui.copyblamethreshold) 40 +set default_config(gui.blamehistoryctx) 7 set default_config(gui.diffcontext) 5 set default_config(gui.commitmsgwidth) 75 set default_config(gui.newbranchtemplate) {} @@ -895,19 +940,25 @@ git-version proc _parse_config {arr_name args} { } proc load_config {include_global} { - global repo_config global_config default_config + global repo_config global_config system_config default_config if {$include_global} { + _parse_config system_config --system _parse_config global_config --global } _parse_config repo_config foreach name [array names default_config] { + if {[catch {set v $system_config($name)}]} { + set system_config($name) $default_config($name) + } + } + foreach name [array names system_config] { if {[catch {set v $global_config($name)}]} { - set global_config($name) $default_config($name) + set global_config($name) $system_config($name) } if {[catch {set v $repo_config($name)}]} { - set repo_config($name) $default_config($name) + set repo_config($name) $system_config($name) } } } @@ -945,17 +996,51 @@ blame { } citool { enable_option singlecommit + enable_option retcode disable_option multicommit disable_option branch disable_option transport + + while {[llength $argv] > 0} { + set a [lindex $argv 0] + switch -- $a { + --amend { + enable_option initialamend + } + --nocommit { + enable_option nocommit + enable_option nocommitmsg + } + --commitmsg { + disable_option nocommitmsg + } + default { + break + } + } + + set argv [lrange $argv 1 end] + } } } ###################################################################### ## +## execution environment + +set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}] + +# Suggest our implementation of askpass, if none is set +if {![info exists env(SSH_ASKPASS)]} { + set env(SSH_ASKPASS) [gitexec git-gui--askpass] +} + +###################################################################### +## ## repository setup +set picked 0 if {[catch { set _gitdir $env(GIT_DIR) set _prefix {} @@ -967,6 +1052,7 @@ if {[catch { load_config 1 apply_config choose_repository::pick + set picked 1 } if {![file isdirectory $_gitdir] && [is_Cygwin]} { catch {set _gitdir [exec cygpath --windows $_gitdir]} @@ -1020,8 +1106,12 @@ set current_branch {} set is_detached 0 set current_diff_path {} set is_3way_diff 0 +set is_conflict_diff 0 set selected_commit_type new +set nullid "0000000000000000000000000000000000000000" +set nullid2 "0000000000000000000000000000000000000001" + ###################################################################### ## ## task management @@ -1102,6 +1192,20 @@ proc PARENT {} { return $empty_tree } +proc force_amend {} { + global selected_commit_type + global HEAD PARENT MERGE_HEAD commit_type + + repository_state newType newHEAD newMERGE_HEAD + set HEAD $newHEAD + set PARENT $newHEAD + set MERGE_HEAD $newMERGE_HEAD + set commit_type $newType + + set selected_commit_type amend + do_select_commit_type +} + proc rescan {after {honor_trustmtime 1}} { global HEAD PARENT MERGE_HEAD commit_type global ui_index ui_workdir ui_comm @@ -1128,6 +1232,7 @@ proc rescan {after {honor_trustmtime 1}} { || [string trim [$ui_comm get 0.0 end]] eq {})} { if {[string match amend* $commit_type]} { } elseif {[load_message GITGUI_MSG]} { + } elseif {[run_prepare_commit_msg_hook]} { } elseif {[load_message MERGE_MSG]} { } elseif {[load_message SQUASH_MSG]} { } @@ -1227,6 +1332,70 @@ proc load_message {file} { return 0 } +proc run_prepare_commit_msg_hook {} { + global pch_error + + # prepare-commit-msg requires PREPARE_COMMIT_MSG exist. From git-gui + # it will be .git/MERGE_MSG (merge), .git/SQUASH_MSG (squash), or an + # empty file but existant file. + + set fd_pcm [open [gitdir PREPARE_COMMIT_MSG] a] + + if {[file isfile [gitdir MERGE_MSG]]} { + set pcm_source "merge" + set fd_mm [open [gitdir MERGE_MSG] r] + 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] + puts -nonewline $fd_pcm [read $fd_sm] + close $fd_sm + } else { + set pcm_source "" + } + + close $fd_pcm + + set fd_ph [githook_read prepare-commit-msg \ + [gitdir PREPARE_COMMIT_MSG] $pcm_source] + if {$fd_ph eq {}} { + catch {file delete [gitdir PREPARE_COMMIT_MSG]} + return 0; + } + + ui_status [mc "Calling prepare-commit-msg hook..."] + set pch_error {} + + fconfigure $fd_ph -blocking 0 -translation binary -eofchar {} + fileevent $fd_ph readable \ + [list prepare_commit_msg_hook_wait $fd_ph] + + return 1; +} + +proc prepare_commit_msg_hook_wait {fd_ph} { + global pch_error + + append pch_error [read $fd_ph] + fconfigure $fd_ph -blocking 1 + if {[eof $fd_ph]} { + if {[catch {close $fd_ph}]} { + ui_status [mc "Commit declined by prepare-commit-msg hook."] + hook_failed_popup prepare-commit-msg $pch_error + catch {file delete [gitdir PREPARE_COMMIT_MSG]} + exit 1 + } else { + load_message PREPARE_COMMIT_MSG + } + set pch_error {} + catch {file delete [gitdir PREPARE_COMMIT_MSG]} + return + } + fconfigure $fd_ph -blocking 0 + catch {file delete [gitdir PREPARE_COMMIT_MSG]} +} + proc read_diff_index {fd after} { global buf_rdi @@ -1322,8 +1491,8 @@ proc rescan_done {fd buf after} { prune_selection unlock_index display_all_files - if {$current_diff_path ne {}} reshow_diff - uplevel #0 $after + if {$current_diff_path ne {}} { reshow_diff $after } + if {$current_diff_path eq {}} { select_first_diff $after } } proc prune_selection {} { @@ -1619,6 +1788,15 @@ static unsigned char file_merge_bits[] = { 0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f}; } -maskdata $filemask +image create bitmap file_statechange -background white -foreground green -data { +#define file_merge_width 14 +#define file_merge_height 15 +static unsigned char file_statechange_bits[] = { + 0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10, + 0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10, + 0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f}; +} -maskdata $filemask + set ui_index .vpane.files.index.list set ui_workdir .vpane.files.workdir.list @@ -1627,12 +1805,14 @@ set all_icons(A$ui_index) file_fulltick set all_icons(M$ui_index) file_fulltick set all_icons(D$ui_index) file_removed set all_icons(U$ui_index) file_merge +set all_icons(T$ui_index) file_statechange set all_icons(_$ui_workdir) file_plain set all_icons(M$ui_workdir) file_mod set all_icons(D$ui_workdir) file_question set all_icons(U$ui_workdir) file_merge set all_icons(O$ui_workdir) file_plain +set all_icons(T$ui_workdir) file_statechange set max_status_desc 0 foreach i { @@ -1643,6 +1823,9 @@ foreach i { {MM {mc "Portions staged for commit"}} {MD {mc "Staged for commit, missing"}} + {_T {mc "File type changed, not staged"}} + {T_ {mc "File type changed, staged"}} + {_O {mc "Untracked, not staged"}} {A_ {mc "Staged for commit"}} {AM {mc "Portions staged for commit"}} @@ -1652,10 +1835,12 @@ foreach i { {D_ {mc "Staged for removal"}} {DO {mc "Staged for removal, still present"}} + {_U {mc "Requires merge resolution"}} {U_ {mc "Requires merge resolution"}} {UU {mc "Requires merge resolution"}} {UM {mc "Requires merge resolution"}} {UD {mc "Requires merge resolution"}} + {UT {mc "Requires merge resolution"}} } { set text [eval [lindex $i 1]] if {$max_status_desc < [string length $text]} { @@ -1729,12 +1914,33 @@ proc do_gitk {revs} { } } +proc do_explore {} { + set explorer {} + if {[is_Cygwin] || [is_Windows]} { + set explorer "explorer.exe" + } elseif {[is_MacOSX]} { + set explorer "open" + } else { + # freedesktop.org-conforming system is our best shot + set explorer "xdg-open" + } + eval exec $explorer [file dirname [gitdir]] & +} + set is_quitting 0 +set ret_code 1 + +proc terminate_me {win} { + global ret_code + if {$win ne {.}} return + exit $ret_code +} -proc do_quit {} { +proc do_quit {{rc {1}}} { global ui_comm is_quitting repo_config commit_type global GITGUI_BCK_exists GITGUI_BCK_i global ui_comm_spell + global ret_code if {$is_quitting} return set is_quitting 1 @@ -1789,6 +1995,7 @@ proc do_quit {} { } } + set ret_code $rc destroy . } @@ -1796,13 +2003,137 @@ proc do_rescan {} { rescan ui_ready } +proc ui_do_rescan {} { + rescan {force_first_diff ui_ready} +} + proc do_commit {} { commit_tree } -proc next_diff {} { +proc next_diff {{after {}}} { global next_diff_p next_diff_w next_diff_i - show_diff $next_diff_p $next_diff_w $next_diff_i + show_diff $next_diff_p $next_diff_w {} {} $after +} + +proc find_anchor_pos {lst name} { + set lid [lsearch -sorted -exact $lst $name] + + if {$lid == -1} { + set lid 0 + foreach lname $lst { + if {$lname >= $name} break + incr lid + } + } + + return $lid +} + +proc find_file_from {flist idx delta path mmask} { + global file_states + + set len [llength $flist] + while {$idx >= 0 && $idx < $len} { + set name [lindex $flist $idx] + + if {$name ne $path && [info exists file_states($name)]} { + set state [lindex $file_states($name) 0] + + if {$mmask eq {} || [regexp $mmask $state]} { + return $idx + } + } + + incr idx $delta + } + + return {} +} + +proc find_next_diff {w path {lno {}} {mmask {}}} { + global next_diff_p next_diff_w next_diff_i + global file_lists ui_index ui_workdir + + set flist $file_lists($w) + if {$lno eq {}} { + set lno [find_anchor_pos $flist $path] + } else { + incr lno -1 + } + + if {$mmask ne {} && ![regexp {(^\^)|(\$$)} $mmask]} { + if {$w eq $ui_index} { + set mmask "^$mmask" + } else { + set mmask "$mmask\$" + } + } + + set idx [find_file_from $flist $lno 1 $path $mmask] + if {$idx eq {}} { + incr lno -1 + set idx [find_file_from $flist $lno -1 $path $mmask] + } + + if {$idx ne {}} { + set next_diff_w $w + set next_diff_p [lindex $flist $idx] + set next_diff_i [expr {$idx+1}] + return 1 + } else { + return 0 + } +} + +proc next_diff_after_action {w path {lno {}} {mmask {}}} { + global current_diff_path + + if {$path ne $current_diff_path} { + return {} + } elseif {[find_next_diff $w $path $lno $mmask]} { + return {next_diff;} + } else { + return {reshow_diff;} + } +} + +proc select_first_diff {after} { + global ui_workdir + + if {[find_next_diff $ui_workdir {} 1 {^_?U}] || + [find_next_diff $ui_workdir {} 1 {[^O]$}]} { + next_diff $after + } else { + uplevel #0 $after + } +} + +proc force_first_diff {after} { + global ui_workdir current_diff_path file_states + + if {[info exists file_states($current_diff_path)]} { + set state [lindex $file_states($current_diff_path) 0] + } else { + set state {OO} + } + + set reselect 0 + if {[string first {U} $state] >= 0} { + # Already a conflict, do nothing + } elseif {[find_next_diff $ui_workdir $current_diff_path {} {^_?U}]} { + set reselect 1 + } elseif {[string index $state 1] ne {O}} { + # Already a diff & no conflicts, do nothing + } elseif {[find_next_diff $ui_workdir $current_diff_path {} {[^O]$}]} { + set reselect 1 + } + + if {$reselect} { + next_diff $after + } else { + uplevel #0 $after + } } proc toggle_or_diff {w x y} { @@ -1823,34 +2154,31 @@ proc toggle_or_diff {w x y} { $ui_index tag remove in_sel 0.0 end $ui_workdir tag remove in_sel 0.0 end + # Determine the state of the file + if {[info exists file_states($path)]} { + set state [lindex $file_states($path) 0] + } else { + set state {__} + } + + # Restage the file, or simply show the diff if {$col == 0 && $y > 1} { - set i [expr {$lno-1}] - set ll [expr {[llength $file_lists($w)]-1}] + # Conflicts need special handling + if {[string first {U} $state] >= 0} { + # $w must always be $ui_workdir, but... + if {$w ne $ui_workdir} { set lno {} } + merge_stage_workdir $path $lno + return + } - if {$i == $ll && $i == 0} { - set after {reshow_diff;} + if {[string index $state 1] eq {O}} { + set mmask {} } else { - global next_diff_p next_diff_w next_diff_i - - set next_diff_w $w - - if {$i < $ll} { - set i [expr {$i + 1}] - set next_diff_i $i - } else { - set next_diff_i $i - set i [expr {$i - 1}] - } - - set next_diff_p [lindex $file_lists($w) $i] - - if {$next_diff_p ne {} && $current_diff_path ne {}} { - set after {next_diff;} - } else { - set after {} - } + set mmask {[^O]} } + set after [next_diff_after_action $w $path $lno $mmask] + if {$w eq $ui_index} { update_indexinfo \ "Unstaging [short_path $path] from commit" \ @@ -1961,6 +2289,9 @@ if {[is_enabled transport]} { .mbar add cascade -label [mc Merge] -menu .mbar.merge .mbar add cascade -label [mc Remote] -menu .mbar.remote } +if {[is_enabled multicommit] || [is_enabled singlecommit]} { + .mbar add cascade -label [mc Tools] -menu .mbar.tools +} . configure -menu .mbar # -- Repository Menu @@ -1968,6 +2299,11 @@ if {[is_enabled transport]} { menu .mbar.repository .mbar.repository add command \ + -label [mc "Explore Working Copy"] \ + -command {do_explore} +.mbar.repository add separator + +.mbar.repository add command \ -label [mc "Browse Current Branch's Files"] \ -command {browser::new $current_branch} set ui_browse_current [.mbar.repository index last] @@ -2091,29 +2427,39 @@ if {[is_enabled branch]} { # -- Commit Menu # +proc commit_btn_caption {} { + if {[is_enabled nocommit]} { + return [mc "Done"] + } else { + return [mc Commit@@verb] + } +} + if {[is_enabled multicommit] || [is_enabled singlecommit]} { menu .mbar.commit - .mbar.commit add radiobutton \ - -label [mc "New Commit"] \ - -command do_select_commit_type \ - -variable selected_commit_type \ - -value new - lappend disable_on_lock \ - [list .mbar.commit entryconf [.mbar.commit index last] -state] + if {![is_enabled nocommit]} { + .mbar.commit add radiobutton \ + -label [mc "New Commit"] \ + -command do_select_commit_type \ + -variable selected_commit_type \ + -value new + lappend disable_on_lock \ + [list .mbar.commit entryconf [.mbar.commit index last] -state] - .mbar.commit add radiobutton \ - -label [mc "Amend Last Commit"] \ - -command do_select_commit_type \ - -variable selected_commit_type \ - -value amend - lappend disable_on_lock \ - [list .mbar.commit entryconf [.mbar.commit index last] -state] + .mbar.commit add radiobutton \ + -label [mc "Amend Last Commit"] \ + -command do_select_commit_type \ + -variable selected_commit_type \ + -value amend + lappend disable_on_lock \ + [list .mbar.commit entryconf [.mbar.commit index last] -state] - .mbar.commit add separator + .mbar.commit add separator + } .mbar.commit add command -label [mc Rescan] \ - -command do_rescan \ + -command ui_do_rescan \ -accelerator F5 lappend disable_on_lock \ [list .mbar.commit entryconf [.mbar.commit index last] -state] @@ -2152,11 +2498,13 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} { .mbar.commit add separator - .mbar.commit add command -label [mc "Sign Off"] \ - -command do_signoff \ - -accelerator $M1T-S + if {![is_enabled nocommitmsg]} { + .mbar.commit add command -label [mc "Sign Off"] \ + -command do_signoff \ + -accelerator $M1T-S + } - .mbar.commit add command -label [mc Commit@@verb] \ + .mbar.commit add command -label [commit_btn_caption] \ -command do_commit \ -accelerator $M1T-Return lappend disable_on_lock \ @@ -2184,11 +2532,15 @@ if {[is_enabled transport]} { menu .mbar.remote .mbar.remote add command \ + -label [mc "Add..."] \ + -command remote_add::dialog \ + -accelerator $M1T-A + .mbar.remote add command \ -label [mc "Push..."] \ -command do_push_anywhere \ -accelerator $M1T-P .mbar.remote add command \ - -label [mc "Delete..."] \ + -label [mc "Delete Branch..."] \ -command remote_branch_delete::dialog } @@ -2214,6 +2566,20 @@ if {[is_MacOSX]} { -command do_options } +# -- Tools Menu +# +if {[is_enabled multicommit] || [is_enabled singlecommit]} { + set tools_menubar .mbar.tools + menu $tools_menubar + $tools_menubar add separator + $tools_menubar add command -label [mc "Add..."] -command tools_add::dialog + $tools_menubar add command -label [mc "Remove..."] -command tools_remove::dialog + set tools_tailcnt 3 + if {[array names repo_config guitool.*.cmd] ne {}} { + tools_populate_all + } +} + # -- Help Menu # .mbar add cascade -label [mc Help] -menu .mbar.help @@ -2224,8 +2590,7 @@ if {![is_MacOSX]} { -command do_about } -set browser {} -catch {set browser $repo_config(instaweb.browser)} + set doc_path [file dirname [gitexec]] set doc_path [file join $doc_path Documentation index.html] @@ -2233,34 +2598,23 @@ if {[is_Cygwin]} { set doc_path [exec cygpath --mixed $doc_path] } -if {$browser eq {}} { - if {[is_MacOSX]} { - set browser open - } elseif {[is_Cygwin]} { - set program_files [file dirname [exec cygpath --windir]] - set program_files [file join $program_files {Program Files}] - set firefox [file join $program_files {Mozilla Firefox} firefox.exe] - set ie [file join $program_files {Internet Explorer} IEXPLORE.EXE] - if {[file exists $firefox]} { - set browser $firefox - } elseif {[file exists $ie]} { - set browser $ie - } - unset program_files firefox ie - } -} - if {[file isfile $doc_path]} { set doc_url "file:$doc_path" } else { set doc_url {http://www.kernel.org/pub/software/scm/git/docs/} } -if {$browser ne {}} { - .mbar.help add command -label [mc "Online Documentation"] \ - -command [list exec $browser $doc_url &] +proc start_browser {url} { + git "web--browse" $url } -unset browser doc_path doc_url + +.mbar.help add command -label [mc "Online Documentation"] \ + -command [list start_browser $doc_url] + +.mbar.help add command -label [mc "Show SSH Key"] \ + -command do_ssh_key + +unset doc_path doc_url # -- Standard bindings # @@ -2281,10 +2635,15 @@ proc usage {} { switch -- $subcommand { browser - blame { - set subcommand_args {rev? path} + if {$subcommand eq "blame"} { + set subcommand_args {[--line=<num>] rev? path} + } else { + set subcommand_args {rev? path} + } if {$argv eq {}} usage set head {} set path {} + set jump_spec {} set is_path 0 foreach a $argv { if {$is_path || [file exists $_prefix$a]} { @@ -2298,6 +2657,9 @@ blame { set path {} } set is_path 1 + } elseif {[regexp {^--line=(\d+)$} $a a lnum]} { + if {$jump_spec ne {} || $head ne {}} usage + set jump_spec [list $lnum] } elseif {$head eq {}} { if {$head ne {}} usage set head $a @@ -2329,6 +2691,7 @@ blame { switch -- $subcommand { browser { + if {$jump_spec ne {}} usage if {$head eq {}} { if {$path ne {} && [file isdirectory $path]} { set head $current_branch @@ -2344,7 +2707,7 @@ blame { puts stderr [mc "fatal: cannot stat path %s: No such file or directory" $path] exit 1 } - blame::new $head $path + blame::new $head $path $jump_spec } } return @@ -2460,7 +2823,7 @@ pack .vpane.lower.commarea.buttons.l -side top -fill x pack .vpane.lower.commarea.buttons -side left -fill y button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \ - -command do_rescan + -command ui_do_rescan pack .vpane.lower.commarea.buttons.rescan -side top -fill x lappend disable_on_lock \ {.vpane.lower.commarea.buttons.rescan conf -state} @@ -2471,19 +2834,23 @@ pack .vpane.lower.commarea.buttons.incall -side top -fill x lappend disable_on_lock \ {.vpane.lower.commarea.buttons.incall conf -state} -button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \ - -command do_signoff -pack .vpane.lower.commarea.buttons.signoff -side top -fill x +if {![is_enabled nocommitmsg]} { + button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \ + -command do_signoff + pack .vpane.lower.commarea.buttons.signoff -side top -fill x +} -button .vpane.lower.commarea.buttons.commit -text [mc Commit@@verb] \ +button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \ -command do_commit pack .vpane.lower.commarea.buttons.commit -side top -fill x lappend disable_on_lock \ {.vpane.lower.commarea.buttons.commit conf -state} -button .vpane.lower.commarea.buttons.push -text [mc Push] \ - -command do_push_anywhere -pack .vpane.lower.commarea.buttons.push -side top -fill x +if {![is_enabled nocommit]} { + button .vpane.lower.commarea.buttons.push -text [mc Push] \ + -command do_push_anywhere + pack .vpane.lower.commarea.buttons.push -side top -fill x +} # -- Commit Message Buffer # @@ -2491,20 +2858,24 @@ frame .vpane.lower.commarea.buffer frame .vpane.lower.commarea.buffer.header set ui_comm .vpane.lower.commarea.buffer.t set ui_coml .vpane.lower.commarea.buffer.header.l -radiobutton .vpane.lower.commarea.buffer.header.new \ - -text [mc "New Commit"] \ - -command do_select_commit_type \ - -variable selected_commit_type \ - -value new -lappend disable_on_lock \ - [list .vpane.lower.commarea.buffer.header.new conf -state] -radiobutton .vpane.lower.commarea.buffer.header.amend \ - -text [mc "Amend Last Commit"] \ - -command do_select_commit_type \ - -variable selected_commit_type \ - -value amend -lappend disable_on_lock \ - [list .vpane.lower.commarea.buffer.header.amend conf -state] + +if {![is_enabled nocommit]} { + radiobutton .vpane.lower.commarea.buffer.header.new \ + -text [mc "New Commit"] \ + -command do_select_commit_type \ + -variable selected_commit_type \ + -value new + lappend disable_on_lock \ + [list .vpane.lower.commarea.buffer.header.new conf -state] + radiobutton .vpane.lower.commarea.buffer.header.amend \ + -text [mc "Amend Last Commit"] \ + -command do_select_commit_type \ + -variable selected_commit_type \ + -value amend + lappend disable_on_lock \ + [list .vpane.lower.commarea.buffer.header.amend conf -state] +} + label $ui_coml \ -anchor w \ -justify left @@ -2522,8 +2893,11 @@ proc trace_commit_type {varname args} { } trace add variable commit_type write trace_commit_type pack $ui_coml -side left -fill x -pack .vpane.lower.commarea.buffer.header.amend -side right -pack .vpane.lower.commarea.buffer.header.new -side right + +if {![is_enabled nocommit]} { + pack .vpane.lower.commarea.buffer.header.amend -side right + pack .vpane.lower.commarea.buffer.header.new -side right +} text $ui_comm -background white -foreground black \ -borderwidth 1 \ @@ -2689,6 +3063,59 @@ $ui_diff tag raise sel # -- Diff Body Context Menu # + +proc create_common_diff_popup {ctxm} { + $ctxm add command \ + -label [mc "Show Less Context"] \ + -command show_less_context + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add command \ + -label [mc "Show More Context"] \ + -command show_more_context + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add separator + $ctxm add command \ + -label [mc Refresh] \ + -command reshow_diff + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add command \ + -label [mc Copy] \ + -command {tk_textCopy $ui_diff} + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add command \ + -label [mc "Select All"] \ + -command {focus $ui_diff;$ui_diff tag add sel 0.0 end} + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add command \ + -label [mc "Copy All"] \ + -command { + $ui_diff tag add sel 0.0 end + tk_textCopy $ui_diff + $ui_diff tag remove sel 0.0 end + } + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add separator + $ctxm add command \ + -label [mc "Decrease Font Size"] \ + -command {incr_font_size font_diff -1} + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add command \ + -label [mc "Increase Font Size"] \ + -command {incr_font_size font_diff 1} + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add separator + set emenu $ctxm.enc + menu $emenu + build_encoding_menu $emenu [list force_diff_encoding] + $ctxm add cascade \ + -label [mc "Encoding"] \ + -menu $emenu + lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] + $ctxm add separator + $ctxm add command -label [mc "Options..."] \ + -command do_options +} + set ctxm .vpane.lower.diff.body.ctxm menu $ctxm -tearoff 0 $ctxm add command \ @@ -2702,71 +3129,65 @@ $ctxm add command \ set ui_diff_applyline [$ctxm index last] lappend diff_actions [list $ctxm entryconf $ui_diff_applyline -state] $ctxm add separator -$ctxm add command \ - -label [mc "Show Less Context"] \ - -command show_less_context -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add command \ - -label [mc "Show More Context"] \ - -command show_more_context -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add separator -$ctxm add command \ - -label [mc Refresh] \ - -command reshow_diff -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add command \ - -label [mc Copy] \ - -command {tk_textCopy $ui_diff} -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add command \ - -label [mc "Select All"] \ - -command {focus $ui_diff;$ui_diff tag add sel 0.0 end} -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add command \ - -label [mc "Copy All"] \ - -command { - $ui_diff tag add sel 0.0 end - tk_textCopy $ui_diff - $ui_diff tag remove sel 0.0 end - } -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add separator -$ctxm add command \ - -label [mc "Decrease Font Size"] \ - -command {incr_font_size font_diff -1} -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add command \ - -label [mc "Increase Font Size"] \ - -command {incr_font_size font_diff 1} -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] -$ctxm add separator -$ctxm add command -label [mc "Options..."] \ - -command do_options -proc popup_diff_menu {ctxm x y X Y} { +create_common_diff_popup $ctxm + +set ctxmmg .vpane.lower.diff.body.ctxmmg +menu $ctxmmg -tearoff 0 +$ctxmmg add command \ + -label [mc "Run Merge Tool"] \ + -command {merge_resolve_tool} +lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state] +$ctxmmg add separator +$ctxmmg add command \ + -label [mc "Use Remote Version"] \ + -command {merge_resolve_one 3} +lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state] +$ctxmmg add command \ + -label [mc "Use Local Version"] \ + -command {merge_resolve_one 2} +lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state] +$ctxmmg add command \ + -label [mc "Revert To Base"] \ + -command {merge_resolve_one 1} +lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state] +$ctxmmg add separator +create_common_diff_popup $ctxmmg + +proc popup_diff_menu {ctxm ctxmmg x y X Y} { global current_diff_path file_states set ::cursorX $x set ::cursorY $y - if {$::ui_index eq $::current_diff_side} { - set l [mc "Unstage Hunk From Commit"] - set t [mc "Unstage Line From Commit"] + if {[info exists file_states($current_diff_path)]} { + set state [lindex $file_states($current_diff_path) 0] } else { - set l [mc "Stage Hunk For Commit"] - set t [mc "Stage Line For Commit"] - } - if {$::is_3way_diff - || $current_diff_path eq {} - || ![info exists file_states($current_diff_path)] - || {_O} eq [lindex $file_states($current_diff_path) 0]} { - set s disabled + set state {__} + } + if {[string first {U} $state] >= 0} { + tk_popup $ctxmmg $X $Y } else { - set s normal + if {$::ui_index eq $::current_diff_side} { + set l [mc "Unstage Hunk From Commit"] + set t [mc "Unstage Line From Commit"] + } else { + set l [mc "Stage Hunk For Commit"] + set t [mc "Stage Line For Commit"] + } + if {$::is_3way_diff + || $current_diff_path eq {} + || {__} eq $state + || {_O} eq $state + || {_T} eq $state + || {T_} eq $state} { + set s disabled + } else { + set s normal + } + $ctxm entryconf $::ui_diff_applyhunk -state $s -label $l + $ctxm entryconf $::ui_diff_applyline -state $s -label $t + tk_popup $ctxm $X $Y } - $ctxm entryconf $::ui_diff_applyhunk -state $s -label $l - $ctxm entryconf $::ui_diff_applyline -state $s -label $t - tk_popup $ctxm $X $Y } -bind_button3 $ui_diff [list popup_diff_menu $ctxm %x %y %X %Y] +bind_button3 $ui_diff [list popup_diff_menu $ctxm $ctxmmg %x %y %X %Y] # -- Status Bar # @@ -2842,9 +3263,9 @@ if {[is_enabled transport]} { bind . <$M1B-Key-P> do_push_anywhere } -bind . <Key-F5> do_rescan -bind . <$M1B-Key-r> do_rescan -bind . <$M1B-Key-R> do_rescan +bind . <Key-F5> ui_do_rescan +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 @@ -2931,8 +3352,7 @@ if {[is_enabled transport]} { load_all_remotes set n [.mbar.remote index end] - populate_push_menu - populate_fetch_menu + populate_remotes_menu set n [expr {[.mbar.remote index end] - $n}] if {$n > 0} { if {[.mbar.remote type 0] eq "tearoff"} { incr n } @@ -3022,7 +3442,23 @@ lock_index begin-read if {![winfo ismapped .]} { wm deiconify . } -after 1 do_rescan +after 1 { + if {[is_enabled initialamend]} { + force_amend + } else { + do_rescan + } + + if {[is_enabled nocommitmsg]} { + $ui_comm configure -state disabled -background gray + } +} if {[is_enabled multicommit]} { after 1000 hint_gc } +if {[is_enabled retcode]} { + bind . <Destroy> {+terminate_me %W} +} +if {$picked && [is_config_true gui.autoexplore]} { + do_explore +} diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl index b6e42cbc8..c1cd7f3b9 100644 --- a/git-gui/lib/blame.tcl +++ b/git-gui/lib/blame.tcl @@ -21,9 +21,11 @@ field w_amov ; # text column: annotations + move tracking field w_asim ; # text column: annotations (simple computation) field w_file ; # text column: actual file data field w_cviewer ; # pane showing commit message +field finder ; # find mini-dialog frame field status ; # status mega-widget instance field old_height ; # last known height of $w.file_pane + # Tk UI colors # variable active_color #c0edc5 @@ -58,8 +60,8 @@ field tooltip_t {} ; # Text widget in $tooltip_wm field tooltip_timer {} ; # Current timer event for our tooltip field tooltip_commit {} ; # Commit(s) in tooltip -constructor new {i_commit i_path} { - global cursor_ptr +constructor new {i_commit i_path i_jump} { + global cursor_ptr M1B M1T have_tk85 variable active_color variable group_colors @@ -69,6 +71,8 @@ constructor new {i_commit i_path} { make_toplevel top w wm title $top [append "[appname] ([reponame]): " [mc "File Viewer"]] + set font_w [font measure font_diff "0"] + frame $w.header -background gold label $w.header.commit_l \ -text [mc "Commit:"] \ @@ -114,9 +118,9 @@ constructor new {i_commit i_path} { pack $w_path -fill x -side right pack $w.header.path_l -side right - panedwindow $w.file_pane -orient vertical - frame $w.file_pane.out - frame $w.file_pane.cm + panedwindow $w.file_pane -orient vertical -borderwidth 0 -sashwidth 3 + frame $w.file_pane.out -relief flat -borderwidth 1 + frame $w.file_pane.cm -relief sunken -borderwidth 1 $w.file_pane add $w.file_pane.out \ -sticky nsew \ -minsize 100 \ @@ -197,6 +201,11 @@ constructor new {i_commit i_path} { -width 80 \ -xscrollcommand [list $w.file_pane.out.sbx set] \ -font font_diff + if {$have_tk85} { + $w_file configure -inactiveselectbackground darkblue + } + $w_file tag conf found \ + -background yellow set w_columns [list $w_amov $w_asim $w_line $w_file] @@ -217,6 +226,11 @@ constructor new {i_commit i_path} { -weight 1 grid rowconfigure $w.file_pane.out 0 -weight 1 + set finder [::searchbar::new \ + $w.file_pane.out.ff $w_file \ + -column [expr {[llength $w_columns] - 1}] \ + ] + set w_cviewer $w.file_pane.cm.t text $w_cviewer \ -background white \ @@ -256,18 +270,41 @@ constructor new {i_commit i_path} { $w.ctxm add command \ -label [mc "Copy Commit"] \ -command [cb _copycommit] + $w.ctxm add separator + $w.ctxm add command \ + -label [mc "Find Text..."] \ + -accelerator F7 \ + -command [list searchbar::show $finder] + menu $w.ctxm.enc + build_encoding_menu $w.ctxm.enc [cb _setencoding] + $w.ctxm add cascade \ + -label [mc "Encoding"] \ + -menu $w.ctxm.enc $w.ctxm add command \ -label [mc "Do Full Copy Detection"] \ -command [cb _fullcopyblame] + $w.ctxm add separator + $w.ctxm add command \ + -label [mc "Show History Context"] \ + -command [cb _gitkcommit] + $w.ctxm add command \ + -label [mc "Blame Parent Commit"] \ + -command [cb _blameparent] foreach i $w_columns { for {set g 0} {$g < [llength $group_colors]} {incr g} { $i tag conf color$g -background [lindex $group_colors $g] } + if {$i eq $w_file} { + $w_file tag raise found + } + $i tag raise sel + $i conf -cursor $cursor_ptr - $i conf -yscrollcommand [list many2scrollbar \ - $w_columns yview $w.file_pane.out.sby] + $i conf -yscrollcommand \ + "[list ::searchbar::scrolled $finder] + [list many2scrollbar $w_columns yview $w.file_pane.out.sby]" bind $i <Button-1> " [cb _hide_tooltip] [cb _click $i @%x,%y] @@ -284,7 +321,7 @@ constructor new {i_commit i_path} { tk_popup $w.ctxm %X %Y " bind $i <Shift-Tab> "[list focus $w_cviewer];break" - bind $i <Tab> "[list focus $w_cviewer];break" + bind $i <Tab> "[cb _focus_search $w_cviewer];break" } foreach i [concat $w_columns $w_cviewer] { @@ -300,10 +337,15 @@ constructor new {i_commit i_path} { bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break} } - bind $w_cviewer <Shift-Tab> "[list focus $w_file];break" + bind $w_cviewer <Shift-Tab> "[cb _focus_search $w_file];break" bind $w_cviewer <Tab> "[list focus $w_file];break" - bind $w_cviewer <Button-1> [list focus $w_cviewer] - bind $w_file <Visibility> [list focus $w_file] + bind $w_cviewer <Button-1> [list focus $w_cviewer] + bind $w_file <Visibility> [cb _focus_search $w_file] + bind $top <F7> [list searchbar::show $finder] + bind $top <Escape> [list searchbar::hide $finder] + bind $top <F3> [list searchbar::find_next $finder] + bind $top <Shift-F3> [list searchbar::find_prev $finder] + catch { bind $top <Shift-Key-XF86_Switch_VT_3> [list searchbar::find_prev $finder] } grid configure $w.header -sticky ew grid configure $w.file_pane -sticky nsew @@ -315,9 +357,14 @@ constructor new {i_commit i_path} { set req_w [winfo reqwidth $top] set req_h [winfo reqheight $top] - set scr_h [expr {[winfo screenheight $top] - 100}] - if {$req_w < 600} {set req_w 600} + set scr_w [expr {[winfo screenwidth $top] - 40}] + set scr_h [expr {[winfo screenheight $top] - 120}] + set opt_w [expr {$font_w * (80 + 5*3 + 3)}] + if {$req_w < $opt_w} {set req_w $opt_w} + if {$req_w > $scr_w} {set req_w $scr_w} + set opt_h [expr {$req_w*4/3}] if {$req_h < $scr_h} {set req_h $scr_h} + if {$req_h > $opt_h} {set req_h $opt_h} set g "${req_w}x${req_h}" wm geometry $top $g update @@ -325,14 +372,29 @@ constructor new {i_commit i_path} { set old_height [winfo height $w.file_pane] $w.file_pane sash place 0 \ [lindex [$w.file_pane sash coord 0] 0] \ - [expr {int($old_height * 0.70)}] + [expr {int($old_height * 0.80)}] bind $w.file_pane <Configure> \ "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}" wm protocol $top WM_DELETE_WINDOW "destroy $top" - bind $top <Destroy> [cb _kill] + bind $top <Destroy> [cb _handle_destroy %W] - _load $this {} + _load $this $i_jump +} + +method _focus_search {win} { + if {[searchbar::visible $finder]} { + focus [searchbar::editor $finder] + } else { + focus $win + } +} + +method _handle_destroy {win} { + if {$win eq $w} { + _kill $this + delete_this + } } method _kill {} { @@ -393,7 +455,10 @@ method _load {jump} { } else { set fd [git_read cat-file blob "$commit:$path"] } - fconfigure $fd -blocking 0 -translation lf -encoding binary + fconfigure $fd \ + -blocking 0 \ + -translation lf \ + -encoding [get_path_encoding $path] fileevent $fd readable [cb _read_file $fd $jump] set current_fd $fd } @@ -494,7 +559,7 @@ method _read_file {fd jump} { } ifdeleted { catch {close $fd} } method _exec_blame {cur_w cur_d options cur_s} { - lappend options --incremental + lappend options --incremental --encoding=utf-8 if {$commit eq {}} { lappend options --contents $path } else { @@ -502,7 +567,7 @@ method _exec_blame {cur_w cur_d options cur_s} { } lappend options -- $path set fd [eval git_read --nice blame $options] - fconfigure $fd -blocking 0 -translation lf -encoding binary + fconfigure $fd -blocking 0 -translation lf -encoding utf-8 fileevent $fd readable [cb _read_blame $fd $cur_w $cur_d] set current_fd $fd set blame_lines 0 @@ -782,24 +847,42 @@ method _click {cur_w pos} { _showcommit $this $cur_w $lno } +method _setencoding {enc} { + force_path_encoding $path $enc + _load $this [list \ + $highlight_column \ + $highlight_line \ + [lindex [$w_file xview] 0] \ + [lindex [$w_file yview] 0] \ + ] +} + method _load_commit {cur_w cur_d pos} { upvar #0 $cur_d line_data set lno [lindex [split [$cur_w index $pos] .] 0] set dat [lindex $line_data $lno] if {$dat ne {}} { - lappend history [list \ - $commit $path \ - $highlight_column \ - $highlight_line \ - [lindex [$w_file xview] 0] \ - [lindex [$w_file yview] 0] \ - ] - set commit [lindex $dat 0] - set path [lindex $dat 1] - _load $this [list [lindex $dat 2]] + _load_new_commit $this \ + [lindex $dat 0] \ + [lindex $dat 1] \ + [list [lindex $dat 2]] } } +method _load_new_commit {new_commit new_path jump} { + lappend history [list \ + $commit $path \ + $highlight_column \ + $highlight_line \ + [lindex [$w_file xview] 0] \ + [lindex [$w_file yview] 0] \ + ] + + set commit $new_commit + set path $new_path + _load $this $jump +} + method _showcommit {cur_w lno} { global repo_config variable active_color @@ -832,6 +915,10 @@ method _showcommit {cur_w lno} { foreach i $w_columns { $i tag conf g$cmit -background $active_color $i tag raise g$cmit + if {$i eq $w_file} { + $w_file tag raise found + } + $i tag raise sel } set author_name {} @@ -867,12 +954,6 @@ method _showcommit {cur_w lno} { set enc [tcl_encoding $enc] if {$enc ne {}} { set msg [encoding convertfrom $enc $msg] - set author_name [encoding convertfrom $enc $author_name] - set committer_name [encoding convertfrom $enc $committer_name] - set header($cmit,author) $author_name - set header($cmit,committer) $committer_name - set header($cmit,summary) \ - [encoding convertfrom $enc $header($cmit,summary)] } set msg [string trim $msg] } @@ -905,10 +986,14 @@ method _showcommit {cur_w lno} { } } -method _copycommit {} { +method _get_click_amov_info {} { set pos @$::cursorX,$::cursorY set lno [lindex [split [$::cursorW index $pos] .] 0] - set dat [lindex $amov_data $lno] + return [lindex $amov_data $lno] +} + +method _copycommit {} { + set dat [_get_click_amov_info $this] if {$dat ne {}} { clipboard clear clipboard append \ @@ -918,6 +1003,147 @@ method _copycommit {} { } } +method _format_offset_date {base offset} { + set exval [expr {$base + $offset*24*60*60}] + return [clock format $exval -format {%Y-%m-%d}] +} + +method _gitkcommit {} { + global nullid + + set dat [_get_click_amov_info $this] + if {$dat ne {}} { + set cmit [lindex $dat 0] + + # If the line belongs to the working copy, use HEAD instead + if {$cmit eq $nullid} { + if {[catch {set cmit [git rev-parse --verify HEAD]} err]} { + error_popup [strcat [mc "Cannot find HEAD commit:"] "\n\n$err"] + return; + } + } + + set radius [get_config gui.blamehistoryctx] + set cmdline [list --select-commit=$cmit] + + if {$radius > 0} { + set author_time {} + set committer_time {} + + catch {set author_time $header($cmit,author-time)} + catch {set committer_time $header($cmit,committer-time)} + + if {$committer_time eq {}} { + set committer_time $author_time + } + + set after_time [_format_offset_date $this $committer_time [expr {-$radius}]] + set before_time [_format_offset_date $this $committer_time $radius] + + lappend cmdline --after=$after_time --before=$before_time + } + + lappend cmdline $cmit + + set base_rev "HEAD" + if {$commit ne {}} { + set base_rev $commit + } + + if {$base_rev ne $cmit} { + lappend cmdline $base_rev + } + + do_gitk $cmdline + } +} + +method _blameparent {} { + global nullid + + set dat [_get_click_amov_info $this] + if {$dat ne {}} { + set cmit [lindex $dat 0] + set new_path [lindex $dat 1] + + # Allow using Blame Parent on lines modified in the working copy + if {$cmit eq $nullid} { + set parent_ref "HEAD" + } else { + set parent_ref "$cmit^" + } + if {[catch {set cparent [git rev-parse --verify $parent_ref]} err]} { + error_popup [strcat [mc "Cannot find parent commit:"] "\n\n$err"] + return; + } + + _kill $this + + # Generate a diff between the commit and its parent, + # and use the hunks to update the line number. + # Request zero context to simplify calculations. + if {$cmit eq $nullid} { + set diffcmd [list diff-index --unified=0 $cparent -- $new_path] + } else { + set diffcmd [list diff-tree --unified=0 $cparent $cmit -- $new_path] + } + if {[catch {set fd [eval git_read $diffcmd]} err]} { + $status stop [mc "Unable to display parent"] + error_popup [strcat [mc "Error loading diff:"] "\n\n$err"] + return + } + + set r_orig_line [lindex $dat 2] + + fconfigure $fd \ + -blocking 0 \ + -encoding binary \ + -translation binary + fileevent $fd readable [cb _read_diff_load_commit \ + $fd $cparent $new_path $r_orig_line] + set current_fd $fd + } +} + +method _read_diff_load_commit {fd cparent new_path tline} { + if {$fd ne $current_fd} { + catch {close $fd} + return + } + + while {[gets $fd line] >= 0} { + if {[regexp {^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@} $line line \ + old_line osz old_size new_line nsz new_size]} { + + if {$osz eq {}} { set old_size 1 } + if {$nsz eq {}} { set new_size 1 } + + if {$new_line <= $tline} { + if {[expr {$new_line + $new_size}] > $tline} { + # Target line within the hunk + set line_shift [expr { + ($new_size-$old_size)*($tline-$new_line)/$new_size + }] + } else { + set line_shift [expr {$new_size-$old_size}] + } + + set r_orig_line [expr {$r_orig_line - $line_shift}] + } + } + } + + if {[eof $fd]} { + close $fd; + set current_fd {} + + _load_new_commit $this \ + $cparent \ + $new_path \ + [list $r_orig_line] + } +} ifdeleted { catch {close $fd} } + method _show_tooltip {cur_w pos} { if {$tooltip_wm ne {}} { _open_tooltip $this $cur_w diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl index ab470d126..0410cc68d 100644 --- a/git-gui/lib/browser.tcl +++ b/git-gui/lib/browser.tcl @@ -151,7 +151,7 @@ method _enter {} { append p [lindex $n 1] } append p $name - blame::new $browser_commit $p + blame::new $browser_commit $p {} } } } diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl index 318078615..f9ff62a3b 100644 --- a/git-gui/lib/choose_repository.tcl +++ b/git-gui/lib/choose_repository.tcl @@ -43,12 +43,18 @@ constructor pick {} { $w.mbar.apple add command \ -label [mc "About %s" [appname]] \ -command do_about + $w.mbar.apple add command \ + -label [mc "Show SSH Key"] \ + -command do_ssh_key } else { $w.mbar add cascade -label [mc Help] -menu $w.mbar.help menu $w.mbar.help $w.mbar.help add command \ -label [mc "About %s" [appname]] \ -command do_about + $w.mbar.help add command \ + -label [mc "Show SSH Key"] \ + -command do_ssh_key } wm protocol $top WM_DELETE_WINDOW exit @@ -381,7 +387,8 @@ method _do_new {} { label $w_body.where.l -text [mc "Directory:"] entry $w_body.where.t \ -textvariable @local_path \ - -font font_diff \ + -borderwidth 1 \ + -relief sunken \ -width 50 button $w_body.where.b \ -text [mc "Browse"] \ @@ -463,20 +470,22 @@ method _do_clone {} { frame $w_body.args pack $args -fill both - label $args.origin_l -text [mc "URL:"] + label $args.origin_l -text [mc "Source Location:"] entry $args.origin_t \ -textvariable @origin_url \ - -font font_diff \ + -borderwidth 1 \ + -relief sunken \ -width 50 button $args.origin_b \ -text [mc "Browse"] \ -command [cb _open_origin] grid $args.origin_l $args.origin_t $args.origin_b -sticky ew - label $args.where_l -text [mc "Directory:"] + label $args.where_l -text [mc "Target Directory:"] entry $args.where_t \ -textvariable @local_path \ - -font font_diff \ + -borderwidth 1 \ + -relief sunken \ -width 50 button $args.where_b \ -text [mc "Browse"] \ @@ -979,7 +988,8 @@ method _do_open {} { label $w_body.where.l -text [mc "Repository:"] entry $w_body.where.t \ -textvariable @local_path \ - -font font_diff \ + -borderwidth 1 \ + -relief sunken \ -width 50 button $w_body.where.b \ -text [mc "Browse"] \ diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 40a710355..334514996 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -149,7 +149,9 @@ The rescan will be automatically started now. _? {continue} A? - D? - + T_ - M? {set files_ready 1} + _U - U? { error_popup [mc "Unmerged files cannot be committed. @@ -166,7 +168,7 @@ File %s cannot be committed by this program. } } } - if {!$files_ready && ![string match *merge $curType]} { + if {!$files_ready && ![string match *merge $curType] && ![is_enabled nocommit]} { info_popup [mc "No changes to commit. You must stage at least 1 file before you can commit. @@ -175,6 +177,8 @@ You must stage at least 1 file before you can commit. return } + if {[is_enabled nocommitmsg]} { do_quit 0 } + # -- A message is required. # set msg [string trim [$ui_comm get 1.0 end]] @@ -210,6 +214,8 @@ A good commit message has the following format: puts $msg_wt $msg close $msg_wt + if {[is_enabled nocommit]} { do_quit 0 } + # -- Run the pre-commit hook. # set fd_ph [githook_read pre-commit] @@ -408,7 +414,7 @@ A rescan will be automatically started now. set ::GITGUI_BCK_exists 0 } - if {[is_enabled singlecommit]} do_quit + if {[is_enabled singlecommit]} { do_quit 0 } # -- Update in memory status # @@ -428,6 +434,7 @@ A rescan will be automatically started now. __ - A_ - M_ - + T_ - D_ { unset file_states($path) catch {unset selected_paths($path)} diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl index 1970b601e..bbbf15c87 100644 --- a/git-gui/lib/diff.tcl +++ b/git-gui/lib/diff.tcl @@ -16,7 +16,7 @@ proc clear_diff {} { $ui_workdir tag remove in_diff 0.0 end } -proc reshow_diff {} { +proc reshow_diff {{after {}}} { global file_states file_lists global current_diff_path current_diff_side global ui_diff @@ -24,13 +24,28 @@ proc reshow_diff {} { set p $current_diff_path if {$p eq {}} { # No diff is being shown. - } elseif {$current_diff_side eq {} - || [catch {set s $file_states($p)}] - || [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} { + } elseif {$current_diff_side eq {}} { clear_diff + } elseif {[catch {set s $file_states($p)}] + || [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} { + + if {[find_next_diff $current_diff_side $p {} {[^O]}]} { + next_diff $after + } else { + clear_diff + } } else { set save_pos [lindex [$ui_diff yview] 0] - show_diff $p $current_diff_side {} $save_pos + show_diff $p $current_diff_side {} $save_pos $after + } +} + +proc force_diff_encoding {enc} { + global current_diff_path + + if {$current_diff_path ne {}} { + force_path_encoding $current_diff_path $enc + reshow_diff } } @@ -54,11 +69,12 @@ A rescan will be automatically started to find other files which may have the sa rescan ui_ready 0 } -proc show_diff {path w {lno {}} {scroll_pos {}}} { +proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} { global file_states file_lists - global is_3way_diff diff_active repo_config + global is_3way_diff is_conflict_diff diff_active repo_config global ui_diff ui_index ui_workdir global current_diff_path current_diff_side current_diff_header + global current_diff_queue if {$diff_active || ![lock_index read]} return @@ -71,21 +87,84 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} { } if {$lno >= 1} { $w tag add in_diff $lno.0 [expr {$lno + 1}].0 + $w see $lno.0 } set s $file_states($path) set m [lindex $s 0] - set is_3way_diff 0 - set diff_active 1 + set is_conflict_diff 0 set current_diff_path $path set current_diff_side $w - set current_diff_header {} + set current_diff_queue {} ui_status [mc "Loading diff of %s..." [escape_path $path]] + set cont_info [list $scroll_pos $callback] + + if {[string first {U} $m] >= 0} { + merge_load_stages $path [list show_unmerged_diff $cont_info] + } elseif {$m eq {_O}} { + show_other_diff $path $w $m $cont_info + } else { + start_show_diff $cont_info + } +} + +proc show_unmerged_diff {cont_info} { + global current_diff_path current_diff_side + global merge_stages ui_diff is_conflict_diff + global current_diff_queue + + if {$merge_stages(2) eq {}} { + set is_conflict_diff 1 + lappend current_diff_queue \ + [list [mc "LOCAL: deleted\nREMOTE:\n"] d======= \ + [list ":1:$current_diff_path" ":3:$current_diff_path"]] + } elseif {$merge_stages(3) eq {}} { + set is_conflict_diff 1 + lappend current_diff_queue \ + [list [mc "REMOTE: deleted\nLOCAL:\n"] d======= \ + [list ":1:$current_diff_path" ":2:$current_diff_path"]] + } elseif {[lindex $merge_stages(1) 0] eq {120000} + || [lindex $merge_stages(2) 0] eq {120000} + || [lindex $merge_stages(3) 0] eq {120000}} { + set is_conflict_diff 1 + lappend current_diff_queue \ + [list [mc "LOCAL:\n"] d======= \ + [list ":1:$current_diff_path" ":2:$current_diff_path"]] + lappend current_diff_queue \ + [list [mc "REMOTE:\n"] d======= \ + [list ":1:$current_diff_path" ":3:$current_diff_path"]] + } else { + start_show_diff $cont_info + return + } + + advance_diff_queue $cont_info +} + +proc advance_diff_queue {cont_info} { + global current_diff_queue ui_diff + + set item [lindex $current_diff_queue 0] + set current_diff_queue [lrange $current_diff_queue 1 end] + + $ui_diff conf -state normal + $ui_diff insert end [lindex $item 0] [lindex $item 1] + $ui_diff conf -state disabled + + start_show_diff $cont_info [lindex $item 2] +} + +proc show_other_diff {path w m cont_info} { + global file_states file_lists + global is_3way_diff diff_active repo_config + global ui_diff ui_index ui_workdir + global current_diff_path current_diff_side current_diff_header + # - Git won't give us the diff, there's nothing to compare to! # if {$m eq {_O}} { - set max_sz [expr {128 * 1024}] + set max_sz 100000 set type unknown if {[catch { set type [file type $path] @@ -101,7 +180,9 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} { } file { set fd [open $path r] - fconfigure $fd -eofchar {} + fconfigure $fd \ + -eofchar {} \ + -encoding [get_path_encoding $path] set content [read $fd $max_sz] close $fd set sz [file size $path] @@ -137,36 +218,57 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} { d_@ } else { if {$sz > $max_sz} { - $ui_diff insert end \ -"* Untracked file is $sz bytes. -* Showing only first $max_sz bytes. -" d_@ + $ui_diff insert end [mc \ +"* Untracked file is %d bytes. +* Showing only first %d bytes. +" $sz $max_sz] d_@ } $ui_diff insert end $content if {$sz > $max_sz} { - $ui_diff insert end " -* Untracked file clipped here by [appname]. + $ui_diff insert end [mc " +* Untracked file clipped here by %s. * To see the entire file, use an external editor. -" d_@ +" [appname]] d_@ } } $ui_diff conf -state disabled set diff_active 0 unlock_index + set scroll_pos [lindex $cont_info 0] if {$scroll_pos ne {}} { update $ui_diff yview moveto $scroll_pos } ui_ready + set callback [lindex $cont_info 1] + if {$callback ne {}} { + eval $callback + } return } +} + +proc start_show_diff {cont_info {add_opts {}}} { + global file_states file_lists + global is_3way_diff diff_active repo_config + global ui_diff ui_index ui_workdir + global current_diff_path current_diff_side current_diff_header + + set path $current_diff_path + set w $current_diff_side + + set s $file_states($path) + set m [lindex $s 0] + set is_3way_diff 0 + set diff_active 1 + set current_diff_header {} set cmd [list] if {$w eq $ui_index} { lappend cmd diff-index lappend cmd --cached } elseif {$w eq $ui_workdir} { - if {[string index $m 0] eq {U}} { + if {[string first {U} $m] >= 0} { lappend cmd diff } else { lappend cmd diff-files @@ -181,8 +283,12 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} { if {$w eq $ui_index} { lappend cmd [PARENT] } - lappend cmd -- - lappend cmd $path + if {$add_opts ne {}} { + eval lappend cmd $add_opts + } else { + lappend cmd -- + lappend cmd $path + } if {[catch {set fd [eval git_read --nice $cmd]} err]} { set diff_active 0 @@ -195,14 +301,15 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} { set ::current_diff_inheader 1 fconfigure $fd \ -blocking 0 \ - -encoding binary \ - -translation binary - fileevent $fd readable [list read_diff $fd $scroll_pos] + -encoding [get_path_encoding $path] \ + -translation lf + fileevent $fd readable [list read_diff $fd $cont_info] } -proc read_diff {fd scroll_pos} { +proc read_diff {fd cont_info} { global ui_diff diff_active - global is_3way_diff current_diff_header + global is_3way_diff is_conflict_diff current_diff_header + global current_diff_queue $ui_diff conf -state normal while {[gets $fd line] >= 0} { @@ -249,6 +356,7 @@ proc read_diff {fd scroll_pos} { {--} {set tags d_--} {++} { if {[regexp {^\+\+([<>]{7} |={7})} $line _g op]} { + set is_conflict_diff 1 set line [string replace $line 0 1 { }] set tags d$op } else { @@ -268,7 +376,7 @@ proc read_diff {fd scroll_pos} { {-} {set tags d_-} {+} { if {[regexp {^\+([<>]{7} |={7})} $line _g op]} { - set line [string replace $line 0 0 { }] + set is_conflict_diff 1 set tags d$op } else { set tags d_+ @@ -290,8 +398,15 @@ proc read_diff {fd scroll_pos} { if {[eof $fd]} { close $fd + + if {$current_diff_queue ne {}} { + advance_diff_queue $cont_info + return + } + set diff_active 0 unlock_index + set scroll_pos [lindex $cont_info 0] if {$scroll_pos ne {}} { update $ui_diff yview moveto $scroll_pos @@ -301,6 +416,10 @@ proc read_diff {fd scroll_pos} { if {[$ui_diff index end] eq {2.0}} { handle_empty_diff } + set callback [lindex $cont_info 1] + if {$callback ne {}} { + eval $callback + } } } @@ -341,8 +460,9 @@ proc apply_hunk {x y} { } if {[catch { + set enc [get_path_encoding $current_diff_path] set p [eval git_write $apply_cmd] - fconfigure $p -translation binary -encoding binary + fconfigure $p -translation binary -encoding $enc puts -nonewline $p $current_diff_header puts -nonewline $p [$ui_diff get $s_lno $e_lno] close $p} err]} { @@ -370,10 +490,9 @@ proc apply_hunk {x y} { } unlock_index display_file $current_diff_path $mi + # This should trigger shift to the next changed file if {$o eq {_}} { - clear_diff - } else { - set current_diff_path $current_diff_path + reshow_diff } } @@ -511,8 +630,9 @@ proc apply_line {x y} { set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch" if {[catch { + set enc [get_path_encoding $current_diff_path] set p [eval git_write $apply_cmd] - fconfigure $p -translation binary -encoding binary + fconfigure $p -translation binary -encoding $enc puts -nonewline $p $current_diff_header puts -nonewline $p $patch close $p} err]} { diff --git a/git-gui/lib/encoding.tcl b/git-gui/lib/encoding.tcl index 7f06b0d47..32668fc9c 100644 --- a/git-gui/lib/encoding.tcl +++ b/git-gui/lib/encoding.tcl @@ -206,7 +206,7 @@ set encoding_aliases { { ISO-8859-16 iso-ir-226 ISO_8859-16:2001 ISO_8859-16 latin10 l10 } { GBK CP936 MS936 windows-936 } { JIS_Encoding csJISEncoding } - { Shift_JIS MS_Kanji csShiftJIS } + { Shift_JIS MS_Kanji csShiftJIS ShiftJIS Shift-JIS } { Extended_UNIX_Code_Packed_Format_for_Japanese csEUCPkdFmtJapanese EUC-JP } { Extended_UNIX_Code_Fixed_Width_for_Japanese csEUCFixWidJapanese } @@ -240,37 +240,227 @@ set encoding_aliases { { Big5 csBig5 } } +set encoding_groups { + {"" "" + {"Unicode" UTF-8} + {"Western" ISO-8859-1}} + {we "West European" + {"Western" ISO-8859-15 CP-437 CP-850 MacRoman CP-1252 Windows-1252} + {"Celtic" ISO-8859-14} + {"Greek" ISO-8859-14 ISO-8859-7 CP-737 CP-869 MacGreek CP-1253 Windows-1253} + {"Icelandic" MacIceland MacIcelandic CP-861} + {"Nordic" ISO-8859-10 CP-865} + {"Portuguese" CP-860} + {"South European" ISO-8859-3}} + {ee "East European" + {"Baltic" CP-775 ISO-8859-4 ISO-8859-13 CP-1257 Windows-1257} + {"Central European" CP-852 ISO-8859-2 MacCE CP-1250 Windows-1250} + {"Croatian" MacCroatian} + {"Cyrillic" CP-855 ISO-8859-5 ISO-IR-111 KOI8-R MacCyrillic CP-1251 Windows-1251} + {"Russian" CP-866} + {"Ukrainian" KOI8-U MacUkraine MacUkrainian} + {"Romanian" ISO-8859-16 MacRomania MacRomanian}} + {ea "East Asian" + {"Generic" ISO-2022} + {"Chinese Simplified" GB2312 GB1988 GB12345 GB2312-RAW GBK EUC-CN GB18030 HZ ISO-2022-CN} + {"Chinese Traditional" Big5 Big5-HKSCS EUC-TW CP-950} + {"Japanese" EUC-JP ISO-2022-JP Shift-JIS JIS-0212 JIS-0208 JIS-0201 CP-932 MacJapan} + {"Korean" EUC-KR UHC JOHAB ISO-2022-KR CP-949 KSC5601}} + {sa "SE & SW Asian" + {"Armenian" ARMSCII-8} + {"Georgian" GEOSTD8} + {"Thai" TIS-620 ISO-8859-11 CP-874 Windows-874 MacThai} + {"Turkish" CP-857 CP857 ISO-8859-9 MacTurkish CP-1254 Windows-1254} + {"Vietnamese" TCVN VISCII VPS CP-1258 Windows-1258} + {"Hindi" MacDevanagari} + {"Gujarati" MacGujarati} + {"Gurmukhi" MacGurmukhi}} + {me "Middle Eastern" + {"Arabic" ISO-8859-6 Windows-1256 CP-1256 CP-864 MacArabic} + {"Farsi" MacFarsi} + {"Hebrew" ISO-8859-8-I Windows-1255 CP-1255 ISO-8859-8 CP-862 MacHebrew}} + {mi "Misc" + {"7-bit" ASCII} + {"16-bit" Unicode} + {"Legacy" CP-863 EBCDIC} + {"Symbol" Symbol Dingbats MacDingbats MacCentEuro}} +} + +proc build_encoding_table {} { + global encoding_aliases encoding_lookup_table + + # Prepare the lookup list; cannot use lsort -nocase because + # of compatibility issues with older Tcl (e.g. in msysgit) + set names [list] + foreach item [encoding names] { + lappend names [list [string tolower $item] $item] + } + set names [lsort -ascii -index 0 $names] + # neither can we use lsearch -index + set lnames [list] + foreach item $names { + lappend lnames [lindex $item 0] + } + + foreach grp $encoding_aliases { + set target {} + foreach item $grp { + set i [lsearch -sorted -ascii $lnames \ + [string tolower $item]] + if {$i >= 0} { + set target [lindex $names $i 1] + break + } + } + if {$target eq {}} continue + foreach item $grp { + set encoding_lookup_table([string tolower $item]) $target + } + } + + foreach item $names { + set encoding_lookup_table([lindex $item 0]) [lindex $item 1] + } +} + proc tcl_encoding {enc} { - global encoding_aliases - set names [encoding names] - set lcnames [string tolower $names] - set enc [string tolower $enc] - set i [lsearch -exact $lcnames $enc] - if {$i < 0} { - # look for "isonnn" instead of "iso-nnn" or "iso_nnn" - if {[regsub {^iso[-_]} $enc iso encx]} { - set i [lsearch -exact $lcnames $encx] + global encoding_lookup_table + if {$enc eq {}} { + return {} + } + if {![info exists encoding_lookup_table]} { + build_encoding_table + } + set enc [string tolower $enc] + if {![info exists encoding_lookup_table($enc)]} { + # look for "isonnn" instead of "iso-nnn" or "iso_nnn" + if {[regsub {^(iso|cp|ibm|jis)[-_]} $enc {\1} encx]} { + set enc $encx + } + } + if {[info exists encoding_lookup_table($enc)]} { + return $encoding_lookup_table($enc) + } else { + return {} + } +} + +proc force_path_encoding {path enc} { + global path_encoding_overrides last_encoding_override + + set enc [tcl_encoding $enc] + if {$enc eq {}} { + catch { unset last_encoding_override } + catch { unset path_encoding_overrides($path) } + } else { + set last_encoding_override $enc + if {$path ne {}} { + set path_encoding_overrides($path) $enc + } + } +} + +proc get_path_encoding {path} { + global path_encoding_overrides last_encoding_override + + if {[info exists last_encoding_override]} { + set tcl_enc $last_encoding_override + } else { + set tcl_enc [tcl_encoding [get_config gui.encoding]] } - } - if {$i < 0} { - foreach l $encoding_aliases { - set ll [string tolower $l] - if {[lsearch -exact $ll $enc] < 0} continue - # look through the aliases for one that tcl knows about - foreach e $ll { - set i [lsearch -exact $lcnames $e] - if {$i < 0} { - if {[regsub {^iso[-_]} $e iso ex]} { - set i [lsearch -exact $lcnames $ex] - } + if {$tcl_enc eq {}} { + set tcl_enc [encoding system] + } + if {$path ne {}} { + if {[info exists path_encoding_overrides($path)]} { + set enc2 $path_encoding_overrides($path) + } else { + set enc2 [tcl_encoding [gitattr $path encoding $tcl_enc]] + } + if {$enc2 ne {}} { + set tcl_enc $enc2 + } + } + return $tcl_enc +} + +proc build_encoding_submenu {parent grp cmd} { + global used_encodings + + set mid [lindex $grp 0] + set gname [mc [lindex $grp 1]] + + set smenu {} + foreach subset [lrange $grp 2 end] { + set name [mc [lindex $subset 0]] + + foreach enc [lrange $subset 1 end] { + set tcl_enc [tcl_encoding $enc] + if {$tcl_enc eq {}} continue + + if {$smenu eq {}} { + if {$mid eq {}} { + set smenu $parent + } else { + set smenu "$parent.$mid" + menu $smenu + $parent add cascade \ + -label $gname \ + -menu $smenu + } + } + + if {$name ne {}} { + set lbl "$name ($enc)" + } else { + set lbl $enc + } + $smenu add command \ + -label $lbl \ + -command [concat $cmd [list $tcl_enc]] + + lappend used_encodings $tcl_enc + } + } +} + +proc popup_btn_menu {m b} { + tk_popup $m [winfo pointerx $b] [winfo pointery $b] +} + +proc build_encoding_menu {emenu cmd {nodef 0}} { + $emenu configure -postcommand \ + [list do_build_encoding_menu $emenu $cmd $nodef] +} + +proc do_build_encoding_menu {emenu cmd {nodef 0}} { + global used_encodings encoding_groups + + $emenu configure -postcommand {} + + if {!$nodef} { + $emenu add command \ + -label [mc "Default"] \ + -command [concat $cmd [list {}]] + } + set sysenc [encoding system] + $emenu add command \ + -label [mc "System (%s)" $sysenc] \ + -command [concat $cmd [list $sysenc]] + + # Main encoding tree + set used_encodings [list identity] + $emenu add separator + foreach grp $encoding_groups { + build_encoding_submenu $emenu $grp $cmd + } + + # Add unclassified encodings + set unused_grp [list [mc Other]] + foreach enc [encoding names] { + if {[lsearch -exact $used_encodings $enc] < 0} { + lappend unused_grp $enc } - if {$i >= 0} break - } - break } - } - if {$i >= 0} { - return [lindex $names $i] - } - return {} + build_encoding_submenu $emenu [list other [mc Other] $unused_grp] $cmd } diff --git a/git-gui/lib/index.tcl b/git-gui/lib/index.tcl index 3c1fce747..d33896a0c 100644 --- a/git-gui/lib/index.tcl +++ b/git-gui/lib/index.tcl @@ -99,6 +99,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} { switch -glob -- [lindex $s 0] { A? {set new _O} M? {set new _M} + T_ {set new _T} D_ {set new _D} D? {set new _?} ?? {continue} @@ -162,6 +163,8 @@ proc write_update_index {fd pathList totalCnt batch after} { ?D {set new D_} _O - AM {set new A_} + _T {set new T_} + _U - U? { if {[file exists $path]} { set new M_ @@ -231,6 +234,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - + ?T - ?D { puts -nonewline $fd "[encoding convertto $path]\0" display_file $path ?_ @@ -252,6 +256,7 @@ proc unstage_helper {txt paths} { switch -glob -- [lindex $file_states($path) 0] { A? - M? - + T_ - D? { lappend pathList $path if {$path eq $current_diff_path} { @@ -293,10 +298,18 @@ proc add_helper {txt paths} { set after {} foreach path $paths { switch -glob -- [lindex $file_states($path) 0] { + _U - + U? { + if {$path eq $current_diff_path} { + unlock_index + merge_stage_workdir $path + return + } + } _O - ?M - ?D - - U? { + ?T { lappend pathList $path if {$path eq $current_diff_path} { set after {reshow_diff;} @@ -336,6 +349,7 @@ proc do_add_all {} { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - + ?T - ?D {lappend paths $path} } } @@ -353,6 +367,7 @@ proc revert_helper {txt paths} { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - + ?T - ?D { lappend pathList $path if {$path eq $current_diff_path} { @@ -409,11 +424,11 @@ proc do_revert_selection {} { if {[array size selected_paths] > 0} { revert_helper \ - {Reverting selected files} \ + [mc "Reverting selected files"] \ [array names selected_paths] } elseif {$current_diff_path ne {}} { revert_helper \ - "Reverting [short_path $current_diff_path]" \ + [mc "Reverting %s" [short_path $current_diff_path]] \ [list $current_diff_path] } } diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl index 5c01875b0..283e4915e 100644 --- a/git-gui/lib/merge.tcl +++ b/git-gui/lib/merge.tcl @@ -40,6 +40,7 @@ The rescan will be automatically started now. _O { continue; # and pray it works! } + _U - U? { error_popup [mc "You are in the middle of a conflicted merge. diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl new file mode 100644 index 000000000..eb2b4b56a --- /dev/null +++ b/git-gui/lib/mergetool.tcl @@ -0,0 +1,393 @@ +# git-gui merge conflict resolution +# parts based on git-mergetool (c) 2006 Theodore Y. Ts'o + +proc merge_resolve_one {stage} { + global current_diff_path + + switch -- $stage { + 1 { set targetquestion [mc "Force resolution to the base version?"] } + 2 { set targetquestion [mc "Force resolution to this branch?"] } + 3 { set targetquestion [mc "Force resolution to the other branch?"] } + } + + set op_question [strcat $targetquestion "\n" \ +[mc "Note that the diff shows only conflicting changes. + +%s will be overwritten. + +This operation can be undone only by restarting the merge." \ + [short_path $current_diff_path]]] + + if {[ask_popup $op_question] eq {yes}} { + merge_load_stages $current_diff_path [list merge_force_stage $stage] + } +} + +proc merge_stage_workdir {path {lno {}}} { + global current_diff_path diff_active + global current_diff_side ui_workdir + + if {$diff_active} return + + if {$path ne $current_diff_path || $ui_workdir ne $current_diff_side} { + show_diff $path $ui_workdir $lno {} [list do_merge_stage_workdir $path] + } else { + do_merge_stage_workdir $path + } +} + +proc do_merge_stage_workdir {path} { + global current_diff_path is_conflict_diff + + if {$path ne $current_diff_path} return; + + if {$is_conflict_diff} { + if {[ask_popup [mc "File %s seems to have unresolved conflicts, still stage?" \ + [short_path $path]]] ne {yes}} { + return + } + } + + merge_add_resolution $path +} + +proc merge_add_resolution {path} { + global current_diff_path ui_workdir + + set after [next_diff_after_action $ui_workdir $path {} {^_?U}] + + update_index \ + [mc "Adding resolution for %s" [short_path $path]] \ + [list $path] \ + [concat $after [list ui_ready]] +} + +proc merge_force_stage {stage} { + global current_diff_path merge_stages + + if {$merge_stages($stage) ne {}} { + git checkout-index -f --stage=$stage -- $current_diff_path + } else { + file delete -- $current_diff_path + } + + merge_add_resolution $current_diff_path +} + +proc merge_load_stages {path cont} { + global merge_stages_fd merge_stages merge_stages_buf + + if {[info exists merge_stages_fd]} { + catch { kill_file_process $merge_stages_fd } + catch { close $merge_stages_fd } + } + + set merge_stages(0) {} + set merge_stages(1) {} + set merge_stages(2) {} + set merge_stages(3) {} + set merge_stages_buf {} + + set merge_stages_fd [eval git_read ls-files -u -z -- $path] + + fconfigure $merge_stages_fd -blocking 0 -translation binary -encoding binary + fileevent $merge_stages_fd readable [list read_merge_stages $merge_stages_fd $cont] +} + +proc read_merge_stages {fd cont} { + global merge_stages_buf merge_stages_fd merge_stages + + append merge_stages_buf [read $fd] + set pck [split $merge_stages_buf "\0"] + set merge_stages_buf [lindex $pck end] + + if {[eof $fd] && $merge_stages_buf ne {}} { + lappend pck {} + set merge_stages_buf {} + } + + foreach p [lrange $pck 0 end-1] { + set fcols [split $p "\t"] + set cols [split [lindex $fcols 0] " "] + set stage [lindex $cols 2] + + set merge_stages($stage) [lrange $cols 0 1] + } + + if {[eof $fd]} { + close $fd + unset merge_stages_fd + eval $cont + } +} + +proc merge_resolve_tool {} { + global current_diff_path + + merge_load_stages $current_diff_path [list merge_resolve_tool2] +} + +proc merge_resolve_tool2 {} { + global current_diff_path merge_stages + + # Validate the stages + if {$merge_stages(2) eq {} || + [lindex $merge_stages(2) 0] eq {120000} || + [lindex $merge_stages(2) 0] eq {160000} || + $merge_stages(3) eq {} || + [lindex $merge_stages(3) 0] eq {120000} || + [lindex $merge_stages(3) 0] eq {160000} + } { + error_popup [mc "Cannot resolve deletion or link conflicts using a tool"] + return + } + + if {![file exists $current_diff_path]} { + error_popup [mc "Conflict file does not exist"] + return + } + + # Determine the tool to use + set tool [get_config merge.tool] + if {$tool eq {}} { set tool meld } + + set merge_tool_path [get_config "mergetool.$tool.path"] + if {$merge_tool_path eq {}} { + switch -- $tool { + emerge { set merge_tool_path "emacs" } + araxis { set merge_tool_path "compare" } + default { set merge_tool_path $tool } + } + } + + # Make file names + set filebase [file rootname $current_diff_path] + set fileext [file extension $current_diff_path] + set basename [lindex [file split $current_diff_path] end] + + set MERGED $current_diff_path + set BASE "./$MERGED.BASE$fileext" + set LOCAL "./$MERGED.LOCAL$fileext" + set REMOTE "./$MERGED.REMOTE$fileext" + set BACKUP "./$MERGED.BACKUP$fileext" + + set base_stage $merge_stages(1) + + # Build the command line + switch -- $tool { + kdiff3 { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" --auto --L1 "$MERGED (Base)" \ + --L2 "$MERGED (Local)" --L3 "$MERGED (Remote)" -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE"] + } else { + set cmdline [list "$merge_tool_path" --auto --L1 "$MERGED (Local)" \ + --L2 "$MERGED (Remote)" -o "$MERGED" "$LOCAL" "$REMOTE"] + } + } + tkdiff { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" -a "$BASE" -o "$MERGED" "$LOCAL" "$REMOTE"] + } else { + set cmdline [list "$merge_tool_path" -o "$MERGED" "$LOCAL" "$REMOTE"] + } + } + meld { + set cmdline [list "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE"] + } + gvimdiff { + set cmdline [list "$merge_tool_path" -f "$LOCAL" "$MERGED" "$REMOTE"] + } + xxdiff { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" -X --show-merged-pane \ + -R {Accel.SaveAsMerged: "Ctrl-S"} \ + -R {Accel.Search: "Ctrl+F"} \ + -R {Accel.SearchForward: "Ctrl-G"} \ + --merged-file "$MERGED" "$LOCAL" "$BASE" "$REMOTE"] + } else { + set cmdline [list "$merge_tool_path" -X --show-merged-pane \ + -R {Accel.SaveAsMerged: "Ctrl-S"} \ + -R {Accel.Search: "Ctrl+F"} \ + -R {Accel.SearchForward: "Ctrl-G"} \ + --merged-file "$MERGED" "$LOCAL" "$REMOTE"] + } + } + opendiff { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"] + } else { + set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -merge "$MERGED"] + } + } + ecmerge { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" --default --mode=merge3 --to="$MERGED"] + } else { + set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" --default --mode=merge2 --to="$MERGED"] + } + } + emerge { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" -f emerge-files-with-ancestor-command \ + "$LOCAL" "$REMOTE" "$BASE" "$basename"] + } else { + set cmdline [list "$merge_tool_path" -f emerge-files-command \ + "$LOCAL" "$REMOTE" "$basename"] + } + } + winmerge { + if {$base_stage ne {}} { + # This tool does not support 3-way merges. + # Use the 'conflict file' resolution feature instead. + set cmdline [list "$merge_tool_path" -e -ub "$MERGED"] + } else { + set cmdline [list "$merge_tool_path" -e -ub -wl \ + -dl "Theirs File" -dr "Mine File" "$REMOTE" "$LOCAL" "$MERGED"] + } + } + araxis { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" -wait -merge -3 -a1 \ + -title1:"'$MERGED (Base)'" -title2:"'$MERGED (Local)'" \ + -title3:"'$MERGED (Remote)'" \ + "$BASE" "$LOCAL" "$REMOTE" "$MERGED"] + } else { + set cmdline [list "$merge_tool_path" -wait -2 \ + -title1:"'$MERGED (Local)'" -title2:"'$MERGED (Remote)'" \ + "$LOCAL" "$REMOTE" "$MERGED"] + } + } + p4merge { + set cmdline [list "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"] + } + vimdiff { + error_popup [mc "Not a GUI merge tool: '%s'" $tool] + return + } + default { + error_popup [mc "Unsupported merge tool '%s'" $tool] + return + } + } + + merge_tool_start $cmdline $MERGED $BACKUP [list $BASE $LOCAL $REMOTE] +} + +proc delete_temp_files {files} { + foreach fname $files { + file delete $fname + } +} + +proc merge_tool_get_stages {target stages} { + global merge_stages + + set i 1 + foreach fname $stages { + if {$merge_stages($i) eq {}} { + file delete $fname + catch { close [open $fname w] } + } else { + # A hack to support autocrlf properly + git checkout-index -f --stage=$i -- $target + file rename -force -- $target $fname + } + incr i + } +} + +proc merge_tool_start {cmdline target backup stages} { + global merge_stages mtool_target mtool_tmpfiles mtool_fd mtool_mtime + + if {[info exists mtool_fd]} { + if {[ask_popup [mc "Merge tool is already running, terminate it?"]] eq {yes}} { + catch { kill_file_process $mtool_fd } + catch { close $mtool_fd } + unset mtool_fd + + set old_backup [lindex $mtool_tmpfiles end] + file rename -force -- $old_backup $mtool_target + delete_temp_files $mtool_tmpfiles + } else { + return + } + } + + # Save the original file + file rename -force -- $target $backup + + # Get the blobs; it destroys $target + if {[catch {merge_tool_get_stages $target $stages} err]} { + file rename -force -- $backup $target + delete_temp_files $stages + error_popup [mc "Error retrieving versions:\n%s" $err] + return + } + + # Restore the conflict file + file copy -force -- $backup $target + + # Initialize global state + set mtool_target $target + set mtool_mtime [file mtime $target] + set mtool_tmpfiles $stages + + lappend mtool_tmpfiles $backup + + # Force redirection to avoid interpreting output on stderr + # as an error, and launch the tool + lappend cmdline {2>@1} + + if {[catch { set mtool_fd [_open_stdout_stderr $cmdline] } err]} { + delete_temp_files $mtool_tmpfiles + error_popup [mc "Could not start the merge tool:\n\n%s" $err] + return + } + + ui_status [mc "Running merge tool..."] + + fconfigure $mtool_fd -blocking 0 -translation binary -encoding binary + fileevent $mtool_fd readable [list read_mtool_output $mtool_fd] +} + +proc read_mtool_output {fd} { + global mtool_fd mtool_tmpfiles + + read $fd + if {[eof $fd]} { + unset mtool_fd + + fconfigure $fd -blocking 1 + merge_tool_finish $fd + } +} + +proc merge_tool_finish {fd} { + global mtool_tmpfiles mtool_target mtool_mtime + + set backup [lindex $mtool_tmpfiles end] + set failed 0 + + # Check the return code + if {[catch {close $fd} err]} { + set failed 1 + if {$err ne {child process exited abnormally}} { + error_popup [strcat [mc "Merge tool failed."] "\n\n$err"] + } + } + + # Finish + if {$failed} { + file rename -force -- $backup $mtool_target + delete_temp_files $mtool_tmpfiles + ui_status [mc "Merge tool failed."] + } else { + if {[is_config_true merge.keepbackup]} { + file rename -force -- $backup "$mtool_target.orig" + } + + delete_temp_files $mtool_tmpfiles + + reshow_diff + } +} diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl index 5e1346e60..1d55b49c9 100644 --- a/git-gui/lib/option.tcl +++ b/git-gui/lib/option.tcl @@ -1,9 +1,31 @@ # git-gui options editor # Copyright (C) 2006, 2007 Shawn Pearce +proc config_check_encodings {} { + global repo_config_new global_config_new + + set enc $global_config_new(gui.encoding) + if {$enc eq {}} { + set global_config_new(gui.encoding) [encoding system] + } elseif {[tcl_encoding $enc] eq {}} { + error_popup [mc "Invalid global encoding '%s'" $enc] + return 0 + } + + set enc $repo_config_new(gui.encoding) + if {$enc eq {}} { + set repo_config_new(gui.encoding) [encoding system] + } elseif {[tcl_encoding $enc] eq {}} { + error_popup [mc "Invalid repo encoding '%s'" $enc] + return 0 + } + + return 1 +} + proc save_config {} { global default_config font_descs - global repo_config global_config + global repo_config global_config system_config global repo_config_new global_config_new global ui_comm_spell @@ -27,7 +49,7 @@ proc save_config {} { foreach name [array names default_config] { set value $global_config_new($name) if {$value ne $global_config($name)} { - if {$value eq $default_config($name)} { + if {$value eq $system_config($name)} { catch {git config --global --unset $name} } else { regsub -all "\[{}\]" $value {"} value @@ -119,15 +141,18 @@ proc do_options {} { {b merge.summary {mc "Summarize Merge Commits"}} {i-1..5 merge.verbosity {mc "Merge Verbosity"}} {b merge.diffstat {mc "Show Diffstat After Merge"}} + {t merge.tool {mc "Use Merge Tool"}} {b gui.trustmtime {mc "Trust File Modification Timestamps"}} {b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}} {b gui.matchtrackingbranch {mc "Match Tracking Branches"}} {b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}} {i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}} + {i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}} {i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}} {i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}} {t gui.newbranchtemplate {mc "New Branch Name Template"}} + {c gui.encoding {mc "Default File Contents Encoding"}} } { set type [lindex $option 0] set name [lindex $option 1] @@ -157,6 +182,7 @@ proc do_options {} { pack $w.$f.$optid.v -side right -anchor e -padx 5 pack $w.$f.$optid -side top -anchor w -fill x } + c - t { frame $w.$f.$optid label $w.$f.$optid.l -text "$text:" @@ -169,6 +195,16 @@ proc do_options {} { pack $w.$f.$optid.v -side left -anchor w \ -fill x -expand 1 \ -padx 5 + if {$type eq {c}} { + menu $w.$f.$optid.m + build_encoding_menu $w.$f.$optid.m \ + [list set ${f}_config_new($name)] 1 + button $w.$f.$optid.b \ + -text [mc "Change"] \ + -command [list popup_btn_menu \ + $w.$f.$optid.m $w.$f.$optid.b] + pack $w.$f.$optid.b -side left -anchor w + } pack $w.$f.$optid -side top -anchor w -fill x } } @@ -248,17 +284,17 @@ proc do_options {} { } proc do_restore_defaults {} { - global font_descs default_config repo_config + global font_descs default_config repo_config system_config global repo_config_new global_config_new foreach name [array names default_config] { - set repo_config_new($name) $default_config($name) - set global_config_new($name) $default_config($name) + set repo_config_new($name) $system_config($name) + set global_config_new($name) $system_config($name) } foreach option $font_descs { set name [lindex $option 0] - set repo_config(gui.$name) $default_config(gui.$name) + set repo_config(gui.$name) $system_config(gui.$name) } apply_config @@ -273,6 +309,7 @@ proc do_restore_defaults {} { } proc do_save_config {w} { + if {![config_check_encodings]} return if {[catch {save_config} err]} { error_popup [strcat [mc "Failed to completely save options:"] "\n\n$err"] } diff --git a/git-gui/lib/remote.tcl b/git-gui/lib/remote.tcl index 0e86ddac0..b92b429cf 100644 --- a/git-gui/lib/remote.tcl +++ b/git-gui/lib/remote.tcl @@ -132,91 +132,145 @@ proc load_all_remotes {} { set all_remotes [lsort -unique $all_remotes] } -proc populate_fetch_menu {} { - global all_remotes repo_config - +proc add_fetch_entry {r} { + global repo_config set remote_m .mbar.remote set fetch_m $remote_m.fetch set prune_m $remote_m.prune - - foreach r $all_remotes { - set enable 0 - if {![catch {set a $repo_config(remote.$r.url)}]} { - if {![catch {set a $repo_config(remote.$r.fetch)}]} { - set enable 1 - } - } else { - catch { - set fd [open [gitdir remotes $r] r] - while {[gets $fd n] >= 0} { - if {[regexp {^Pull:[ \t]*([^:]+):} $n]} { - set enable 1 - break - } + set remove_m $remote_m.remove + set enable 0 + if {![catch {set a $repo_config(remote.$r.url)}]} { + if {![catch {set a $repo_config(remote.$r.fetch)}]} { + set enable 1 + } + } else { + catch { + set fd [open [gitdir remotes $r] r] + while {[gets $fd n] >= 0} { + if {[regexp {^Pull:[ \t]*([^:]+):} $n]} { + set enable 1 + break } - close $fd } + close $fd } + } - if {$enable} { - if {![winfo exists $fetch_m]} { - menu $prune_m - $remote_m insert 0 cascade \ - -label [mc "Prune from"] \ - -menu $prune_m - - menu $fetch_m - $remote_m insert 0 cascade \ - -label [mc "Fetch from"] \ - -menu $fetch_m - } + if {$enable} { + if {![winfo exists $fetch_m]} { + menu $remove_m + $remote_m insert 0 cascade \ + -label [mc "Remove Remote"] \ + -menu $remove_m + + menu $prune_m + $remote_m insert 0 cascade \ + -label [mc "Prune from"] \ + -menu $prune_m - $fetch_m add command \ - -label $r \ - -command [list fetch_from $r] - $prune_m add command \ - -label $r \ - -command [list prune_from $r] + menu $fetch_m + $remote_m insert 0 cascade \ + -label [mc "Fetch from"] \ + -menu $fetch_m } + + $fetch_m add command \ + -label $r \ + -command [list fetch_from $r] + $prune_m add command \ + -label $r \ + -command [list prune_from $r] + $remove_m add command \ + -label $r \ + -command [list remove_remote $r] } } -proc populate_push_menu {} { - global all_remotes repo_config - +proc add_push_entry {r} { + global repo_config set remote_m .mbar.remote set push_m $remote_m.push - - foreach r $all_remotes { - set enable 0 - if {![catch {set a $repo_config(remote.$r.url)}]} { - if {![catch {set a $repo_config(remote.$r.push)}]} { - set enable 1 - } - } else { - catch { - set fd [open [gitdir remotes $r] r] - while {[gets $fd n] >= 0} { - if {[regexp {^Push:[ \t]*([^:]+):} $n]} { - set enable 1 - break - } + set enable 0 + if {![catch {set a $repo_config(remote.$r.url)}]} { + if {![catch {set a $repo_config(remote.$r.push)}]} { + set enable 1 + } + } else { + catch { + set fd [open [gitdir remotes $r] r] + while {[gets $fd n] >= 0} { + if {[regexp {^Push:[ \t]*([^:]+):} $n]} { + set enable 1 + break } - close $fd } + close $fd } + } - if {$enable} { - if {![winfo exists $push_m]} { - menu $push_m - $remote_m insert 0 cascade \ - -label [mc "Push to"] \ - -menu $push_m - } - - $push_m add command \ - -label $r \ - -command [list push_to $r] + if {$enable} { + if {![winfo exists $push_m]} { + menu $push_m + $remote_m insert 0 cascade \ + -label [mc "Push to"] \ + -menu $push_m } + + $push_m add command \ + -label $r \ + -command [list push_to $r] + } +} + +proc populate_remotes_menu {} { + global all_remotes + + foreach r $all_remotes { + add_fetch_entry $r + add_push_entry $r + } +} + +proc add_single_remote {name location} { + global all_remotes repo_config + lappend all_remotes $name + + git remote add $name $location + + # XXX: Better re-read the config so that we will never get out + # of sync with git remote implementation? + set repo_config(remote.$name.url) $location + set repo_config(remote.$name.fetch) "+refs/heads/*:refs/remotes/$name/*" + + add_fetch_entry $name + add_push_entry $name +} + +proc delete_from_menu {menu name} { + if {[winfo exists $menu]} { + $menu delete $name } } + +proc remove_remote {name} { + global all_remotes repo_config + + git remote rm $name + + catch { + # Missing values are ok + unset repo_config(remote.$name.url) + unset repo_config(remote.$name.fetch) + unset repo_config(remote.$name.push) + } + + set i [lsearch -exact all_remotes $name] + lreplace all_remotes $i $i + + set remote_m .mbar.remote + delete_from_menu $remote_m.fetch $name + delete_from_menu $remote_m.prune $name + delete_from_menu $remote_m.remove $name + # Not all remotes are in the push menu + catch { delete_from_menu $remote_m.push $name } +} diff --git a/git-gui/lib/remote_add.tcl b/git-gui/lib/remote_add.tcl new file mode 100644 index 000000000..fb29422aa --- /dev/null +++ b/git-gui/lib/remote_add.tcl @@ -0,0 +1,191 @@ +# git-gui remote adding support +# Copyright (C) 2008 Petr Baudis + +class remote_add { + +field w ; # widget path +field w_name ; # new remote name widget +field w_loc ; # new remote location widget + +field name {}; # name of the remote the user has chosen +field location {}; # location of the remote the user has chosen + +field opt_action fetch; # action to do after registering the remote locally + +constructor dialog {} { + global repo_config + + make_toplevel top w + wm title $top [append "[appname] ([reponame]): " [mc "Add Remote"]] + if {$top ne {.}} { + wm geometry $top "+[winfo rootx .]+[winfo rooty .]" + } + + label $w.header -text [mc "Add New Remote"] -font font_uibold + pack $w.header -side top -fill x + + frame $w.buttons + button $w.buttons.create -text [mc Add] \ + -default active \ + -command [cb _add] + pack $w.buttons.create -side right + button $w.buttons.cancel -text [mc Cancel] \ + -command [list destroy $w] + pack $w.buttons.cancel -side right -padx 5 + pack $w.buttons -side bottom -fill x -pady 10 -padx 10 + + labelframe $w.desc -text [mc "Remote Details"] + + label $w.desc.name_l -text [mc "Name:"] + set w_name $w.desc.name_t + entry $w_name \ + -borderwidth 1 \ + -relief sunken \ + -width 40 \ + -textvariable @name \ + -validate key \ + -validatecommand [cb _validate_name %d %S] + grid $w.desc.name_l $w_name -sticky we -padx {0 5} + + label $w.desc.loc_l -text [mc "Location:"] + set w_loc $w.desc.loc_t + entry $w_loc \ + -borderwidth 1 \ + -relief sunken \ + -width 40 \ + -textvariable @location + grid $w.desc.loc_l $w_loc -sticky we -padx {0 5} + + grid columnconfigure $w.desc 1 -weight 1 + pack $w.desc -anchor nw -fill x -pady 5 -padx 5 + + labelframe $w.action -text [mc "Further Action"] + + radiobutton $w.action.fetch \ + -text [mc "Fetch Immediately"] \ + -value fetch \ + -variable @opt_action + pack $w.action.fetch -anchor nw + + radiobutton $w.action.push \ + -text [mc "Initialize Remote Repository and Push"] \ + -value push \ + -variable @opt_action + pack $w.action.push -anchor nw + + radiobutton $w.action.none \ + -text [mc "Do Nothing Else Now"] \ + -value none \ + -variable @opt_action + pack $w.action.none -anchor nw + + grid columnconfigure $w.action 1 -weight 1 + pack $w.action -anchor nw -fill x -pady 5 -padx 5 + + bind $w <Visibility> [cb _visible] + bind $w <Key-Escape> [list destroy $w] + bind $w <Key-Return> [cb _add]\;break + tkwait window $w +} + +method _add {} { + global repo_config env + global M1B + + if {$name eq {}} { + tk_messageBox \ + -icon error \ + -type ok \ + -title [wm title $w] \ + -parent $w \ + -message [mc "Please supply a remote name."] + focus $w_name + return + } + + # XXX: We abuse check-ref-format here, but + # that should be ok. + if {[catch {git check-ref-format "remotes/$name"}]} { + tk_messageBox \ + -icon error \ + -type ok \ + -title [wm title $w] \ + -parent $w \ + -message [mc "'%s' is not an acceptable remote name." $name] + focus $w_name + return + } + + if {[catch {add_single_remote $name $location}]} { + tk_messageBox \ + -icon error \ + -type ok \ + -title [wm title $w] \ + -parent $w \ + -message [mc "Failed to add remote '%s' of location '%s'." $name $location] + focus $w_name + return + } + + switch -- $opt_action { + fetch { + set c [console::new \ + [mc "fetch %s" $name] \ + [mc "Fetching the %s" $name]] + console::exec $c [list git fetch $name] + } + push { + set cmds [list] + + # Parse the location + if { [regexp {(?:git\+)?ssh://([^/]+)(/.+)} $location xx host path] + || [regexp {([^:][^:]+):(.+)} $location xx host path]} { + set ssh ssh + if {[info exists env(GIT_SSH)]} { + set ssh $env(GIT_SSH) + } + lappend cmds [list exec $ssh $host mkdir -p $location && git --git-dir=$path init --bare] + } elseif { ! [regexp {://} $location xx] } { + lappend cmds [list exec mkdir -p $location] + lappend cmds [list exec git --git-dir=$location init --bare] + } else { + tk_messageBox \ + -icon error \ + -type ok \ + -title [wm title $w] \ + -parent $w \ + -message [mc "Do not know how to initialize repository at location '%s'." $location] + destroy $w + return + } + + set c [console::new \ + [mc "push %s" $name] \ + [mc "Setting up the %s (at %s)" $name $location]] + + lappend cmds [list exec git push -v --all $name] + console::chain $c $cmds + } + none { + } + } + + destroy $w +} + +method _validate_name {d S} { + if {$d == 1} { + if {[regexp {[~^:?*\[\0- ]} $S]} { + return 0 + } + } + return 1 +} + +method _visible {} { + grab $w + $w_name icursor end + focus $w_name +} + +} diff --git a/git-gui/lib/remote_branch_delete.tcl b/git-gui/lib/remote_branch_delete.tcl index c7b814869..89eb0f70f 100644 --- a/git-gui/lib/remote_branch_delete.tcl +++ b/git-gui/lib/remote_branch_delete.tcl @@ -26,12 +26,12 @@ constructor dialog {} { global all_remotes M1B make_toplevel top w - wm title $top [append "[appname] ([reponame]): " [mc "Delete Remote Branch"]] + wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch Remotely"]] if {$top ne {.}} { wm geometry $top "+[winfo rootx .]+[winfo rooty .]" } - label $w.header -text [mc "Delete Remote Branch"] -font font_uibold + label $w.header -text [mc "Delete Branch Remotely"] -font font_uibold pack $w.header -side top -fill x frame $w.buttons @@ -63,7 +63,7 @@ constructor dialog {} { set urltype url } radiobutton $w.dest.url_r \ - -text [mc "Arbitrary URL:"] \ + -text [mc "Arbitrary Location:"] \ -value url \ -variable @urltype entry $w.dest.url_t \ diff --git a/git-gui/lib/search.tcl b/git-gui/lib/search.tcl new file mode 100644 index 000000000..b371e9a30 --- /dev/null +++ b/git-gui/lib/search.tcl @@ -0,0 +1,198 @@ +# incremental search panel +# based on code from gitk, Copyright (C) Paul Mackerras + +class searchbar { + +field w +field ctext + +field searchstring {} +field casesensitive 1 +field searchdirn -forwards + +field smarktop +field smarkbot + +constructor new {i_w i_text args} { + set w $i_w + set ctext $i_text + + frame $w + label $w.l -text [mc Find:] + entry $w.ent -textvariable ${__this}::searchstring -background lightgreen + button $w.bn -text [mc Next] -command [cb find_next] + button $w.bp -text [mc Prev] -command [cb find_prev] + checkbutton $w.cs -text [mc Case-Sensitive] \ + -variable ${__this}::casesensitive -command [cb _incrsearch] + pack $w.l -side left + pack $w.cs -side right + pack $w.bp -side right + pack $w.bn -side right + pack $w.ent -side left -expand 1 -fill x + + eval grid conf $w -sticky we $args + grid remove $w + + trace add variable searchstring write [cb _incrsearch_cb] + + bind $w <Destroy> [list delete_this $this] + return $this +} + +method show {} { + if {![visible $this]} { + grid $w + } + focus -force $w.ent +} + +method hide {} { + if {[visible $this]} { + focus $ctext + grid remove $w + } +} + +method visible {} { + return [winfo ismapped $w] +} + +method editor {} { + return $w.ent +} + +method _get_new_anchor {} { + # use start of selection if it is visible, + # or the bounds of the visible area + set top [$ctext index @0,0] + set bottom [$ctext index @0,[winfo height $ctext]] + set sel [$ctext tag ranges sel] + if {$sel ne {}} { + set spos [lindex $sel 0] + if {[lindex $spos 0] >= [lindex $top 0] && + [lindex $spos 0] <= [lindex $bottom 0]} { + return $spos + } + } + if {$searchdirn eq "-forwards"} { + return $top + } else { + return $bottom + } +} + +method _get_wrap_anchor {dir} { + if {$dir eq "-forwards"} { + return 1.0 + } else { + return end + } +} + +method _do_search {start {mlenvar {}} {dir {}} {endbound {}}} { + set cmd [list $ctext search] + if {$mlenvar ne {}} { + upvar $mlenvar mlen + lappend cmd -count mlen + } + if {!$casesensitive} { + lappend cmd -nocase + } + if {$dir eq {}} { + set dir $searchdirn + } + lappend cmd $dir -- $searchstring + if {$endbound ne {}} { + set here [eval $cmd [list $start] [list $endbound]] + } else { + set here [eval $cmd [list $start]] + if {$here eq {}} { + set here [eval $cmd [_get_wrap_anchor $this $dir]] + } + } + return $here +} + +method _incrsearch_cb {name ix op} { + after idle [cb _incrsearch] +} + +method _incrsearch {} { + $ctext tag remove found 1.0 end + if {[catch {$ctext index anchor}]} { + $ctext mark set anchor [_get_new_anchor $this] + } + if {$searchstring ne {}} { + set here [_do_search $this anchor mlen] + if {$here ne {}} { + $ctext see $here + $ctext tag remove sel 1.0 end + $ctext tag add sel $here "$here + $mlen c" + $w.ent configure -background lightgreen + _set_marks $this 1 + } else { + $w.ent configure -background lightpink + } + } +} + +method find_prev {} { + find_next $this -backwards +} + +method find_next {{dir -forwards}} { + focus $w.ent + $w.ent icursor end + set searchdirn $dir + $ctext mark unset anchor + if {$searchstring ne {}} { + set start [_get_new_anchor $this] + if {$dir eq "-forwards"} { + set start "$start + 1c" + } + set match [_do_search $this $start mlen] + $ctext tag remove sel 1.0 end + if {$match ne {}} { + $ctext see $match + $ctext tag add sel $match "$match + $mlen c" + } + } +} + +method _mark_range {first last} { + set mend $first.0 + while {1} { + set match [_do_search $this $mend mlen -forwards $last.end] + if {$match eq {}} break + set mend "$match + $mlen c" + $ctext tag add found $match $mend + } +} + +method _set_marks {doall} { + set topline [lindex [split [$ctext index @0,0] .] 0] + set botline [lindex [split [$ctext index @0,[winfo height $ctext]] .] 0] + if {$doall || $botline < $smarktop || $topline > $smarkbot} { + # no overlap with previous + _mark_range $this $topline $botline + set smarktop $topline + set smarkbot $botline + } else { + if {$topline < $smarktop} { + _mark_range $this $topline [expr {$smarktop-1}] + set smarktop $topline + } + if {$botline > $smarkbot} { + _mark_range $this [expr {$smarkbot+1}] $botline + set smarkbot $botline + } + } +} + +method scrolled {} { + if {$searchstring ne {}} { + after idle [cb _set_marks 0] + } +} + +}
\ No newline at end of file diff --git a/git-gui/lib/spellcheck.tcl b/git-gui/lib/spellcheck.tcl index a479b2f28..e6120303e 100644 --- a/git-gui/lib/spellcheck.tcl +++ b/git-gui/lib/spellcheck.tcl @@ -314,6 +314,7 @@ method _run {} { method _read {} { while {[gets $s_fd line] >= 0} { set lineno [lindex $s_pending 0 0] + set line [string trim $line] if {$s_clear} { $w_text tag remove misspelled "$lineno.0" "$lineno.end" diff --git a/git-gui/lib/sshkey.tcl b/git-gui/lib/sshkey.tcl new file mode 100644 index 000000000..82a1a80ff --- /dev/null +++ b/git-gui/lib/sshkey.tcl @@ -0,0 +1,126 @@ +# git-gui about git-gui dialog +# Copyright (C) 2006, 2007 Shawn Pearce + +proc find_ssh_key {} { + foreach name {~/.ssh/id_dsa.pub ~/.ssh/id_rsa.pub ~/.ssh/identity.pub} { + if {[file exists $name]} { + set fh [open $name r] + set cont [read $fh] + close $fh + return [list $name $cont] + } + } + + return {} +} + +proc do_ssh_key {} { + global sshkey_title have_tk85 sshkey_fd + + set w .sshkey_dialog + if {[winfo exists $w]} { + raise $w + return + } + + toplevel $w + wm transient $w . + + set finfo [find_ssh_key] + if {$finfo eq {}} { + set sshkey_title [mc "No keys found."] + set gen_state normal + } else { + set sshkey_title [mc "Found a public key in: %s" [lindex $finfo 0]] + set gen_state disabled + } + + frame $w.header -relief flat + label $w.header.lbl -textvariable sshkey_title -anchor w + button $w.header.gen -text [mc "Generate Key"] \ + -command [list make_ssh_key $w] -state $gen_state + pack $w.header.lbl -side left -expand 1 -fill x + pack $w.header.gen -side right + pack $w.header -fill x -pady 5 -padx 5 + + text $w.contents -width 60 -height 10 -wrap char -relief sunken + pack $w.contents -fill both -expand 1 + if {$have_tk85} { + $w.contents configure -inactiveselectbackground darkblue + } + + frame $w.buttons + button $w.buttons.close -text [mc Close] \ + -default active -command [list destroy $w] + pack $w.buttons.close -side right + button $w.buttons.copy -text [mc "Copy To Clipboard"] \ + -command [list tk_textCopy $w.contents] + pack $w.buttons.copy -side left + pack $w.buttons -side bottom -fill x -pady 5 -padx 5 + + if {$finfo ne {}} { + $w.contents insert end [lindex $finfo 1] sel + } + $w.contents configure -state disabled + + bind $w <Visibility> "grab $w; focus $w.buttons.close" + bind $w <Key-Escape> "destroy $w" + bind $w <Key-Return> "destroy $w" + bind $w <Destroy> kill_sshkey + wm title $w [mc "Your OpenSSH Public Key"] + tk::PlaceWindow $w widget . + tkwait window $w +} + +proc make_ssh_key {w} { + global sshkey_title sshkey_output sshkey_fd + + set sshkey_title [mc "Generating..."] + $w.header.gen configure -state disabled + + set cmdline [list sh -c {echo | ssh-keygen -q -t rsa -f ~/.ssh/id_rsa 2>&1}] + + if {[catch { set sshkey_fd [_open_stdout_stderr $cmdline] } err]} { + error_popup [mc "Could not start ssh-keygen:\n\n%s" $err] + return + } + + set sshkey_output {} + fconfigure $sshkey_fd -blocking 0 + fileevent $sshkey_fd readable [list read_sshkey_output $sshkey_fd $w] +} + +proc kill_sshkey {} { + global sshkey_fd + if {![info exists sshkey_fd]} return + catch { kill_file_process $sshkey_fd } + catch { close $sshkey_fd } +} + +proc read_sshkey_output {fd w} { + global sshkey_fd sshkey_output sshkey_title + + set sshkey_output "$sshkey_output[read $fd]" + if {![eof $fd]} return + + fconfigure $fd -blocking 1 + unset sshkey_fd + + $w.contents configure -state normal + if {[catch {close $fd} err]} { + set sshkey_title [mc "Generation failed."] + $w.contents insert end $err + $w.contents insert end "\n" + $w.contents insert end $sshkey_output + } else { + set finfo [find_ssh_key] + if {$finfo eq {}} { + set sshkey_title [mc "Generation succeded, but no keys found."] + $w.contents insert end $sshkey_output + } else { + set sshkey_title [mc "Your key is in: %s" [lindex $finfo 0]] + $w.contents insert end [lindex $finfo 1] sel + } + } + $w.contents configure -state disable +} diff --git a/git-gui/lib/tools.tcl b/git-gui/lib/tools.tcl new file mode 100644 index 000000000..6ae63b6c7 --- /dev/null +++ b/git-gui/lib/tools.tcl @@ -0,0 +1,159 @@ +# git-gui Tools menu implementation + +proc tools_list {} { + global repo_config + + set names {} + foreach item [array names repo_config guitool.*.cmd] { + lappend names [string range $item 8 end-4] + } + return [lsort $names] +} + +proc tools_populate_all {} { + global tools_menubar tools_menutbl + global tools_tailcnt + + set mbar_end [$tools_menubar index end] + set mbar_base [expr {$mbar_end - $tools_tailcnt}] + if {$mbar_base >= 0} { + $tools_menubar delete 0 $mbar_base + } + + array unset tools_menutbl + + foreach fullname [tools_list] { + tools_populate_one $fullname + } +} + +proc tools_create_item {parent args} { + global tools_menubar tools_tailcnt + if {$parent eq $tools_menubar} { + set pos [expr {[$parent index end]-$tools_tailcnt+1}] + eval [list $parent insert $pos] $args + } else { + eval [list $parent add] $args + } +} + +proc tools_populate_one {fullname} { + global tools_menubar tools_menutbl tools_id + + if {![info exists tools_id]} { + set tools_id 0 + } + + set names [split $fullname '/'] + set parent $tools_menubar + for {set i 0} {$i < [llength $names]-1} {incr i} { + set subname [join [lrange $names 0 $i] '/'] + if {[info exists tools_menutbl($subname)]} { + set parent $tools_menutbl($subname) + } else { + set subid $parent.t$tools_id + tools_create_item $parent cascade \ + -label [lindex $names $i] -menu $subid + menu $subid + set tools_menutbl($subname) $subid + set parent $subid + incr tools_id + } + } + + tools_create_item $parent command \ + -label [lindex $names end] \ + -command [list tools_exec $fullname] +} + +proc tools_exec {fullname} { + global repo_config env current_diff_path + global current_branch is_detached + + if {[is_config_true "guitool.$fullname.needsfile"]} { + if {$current_diff_path eq {}} { + error_popup [mc "Running %s requires a selected file." $fullname] + return + } + } + + catch { unset env(ARGS) } + catch { unset env(REVISION) } + + if {[get_config "guitool.$fullname.revprompt"] ne {} || + [get_config "guitool.$fullname.argprompt"] ne {}} { + set dlg [tools_askdlg::dialog $fullname] + if {![tools_askdlg::execute $dlg]} { + return + } + } elseif {[is_config_true "guitool.$fullname.confirm"]} { + if {[ask_popup [mc "Are you sure you want to run %s?" $fullname]] ne {yes}} { + return + } + } + + set env(GIT_GUITOOL) $fullname + set env(FILENAME) $current_diff_path + if {$is_detached} { + set env(CUR_BRANCH) "" + } else { + set env(CUR_BRANCH) $current_branch + } + + set cmdline $repo_config(guitool.$fullname.cmd) + if {[is_config_true "guitool.$fullname.noconsole"]} { + tools_run_silent [list sh -c $cmdline] \ + [list tools_complete $fullname {}] + } else { + regsub {/} $fullname { / } title + set w [console::new \ + [mc "Tool: %s" $title] \ + [mc "Running: %s" $cmdline]] + console::exec $w [list sh -c $cmdline] \ + [list tools_complete $fullname $w] + } + + unset env(GIT_GUITOOL) + unset env(FILENAME) + unset env(CUR_BRANCH) + catch { unset env(ARGS) } + catch { unset env(REVISION) } +} + +proc tools_run_silent {cmd after} { + lappend cmd 2>@1 + set fd [_open_stdout_stderr $cmd] + + fconfigure $fd -blocking 0 -translation binary + fileevent $fd readable [list tools_consume_input $fd $after] +} + +proc tools_consume_input {fd after} { + read $fd + if {[eof $fd]} { + fconfigure $fd -blocking 1 + if {[catch {close $fd}]} { + uplevel #0 $after 0 + } else { + uplevel #0 $after 1 + } + } +} + +proc tools_complete {fullname w {ok 1}} { + if {$w ne {}} { + console::done $w $ok + } + + if {$ok} { + set msg [mc "Tool completed succesfully: %s" $fullname] + } else { + set msg [mc "Tool failed: %s" $fullname] + } + + if {[is_config_true "guitool.$fullname.norescan"]} { + ui_status $msg + } else { + rescan [list ui_status $msg] + } +} diff --git a/git-gui/lib/tools_dlg.tcl b/git-gui/lib/tools_dlg.tcl new file mode 100644 index 000000000..5f7f08e23 --- /dev/null +++ b/git-gui/lib/tools_dlg.tcl @@ -0,0 +1,421 @@ +# git-gui Tools menu dialogs + +class tools_add { + +field w ; # widget path +field w_name ; # new remote name widget +field w_cmd ; # new remote location widget + +field name {}; # name of the tool +field command {}; # command to execute +field add_global 0; # add to the --global config +field no_console 0; # disable using the console +field needs_file 0; # ensure filename is set +field confirm 0; # ask for confirmation +field ask_branch 0; # ask for a revision +field ask_args 0; # ask for additional args + +constructor dialog {} { + global repo_config + + make_toplevel top w + wm title $top [append "[appname] ([reponame]): " [mc "Add Tool"]] + if {$top ne {.}} { + wm geometry $top "+[winfo rootx .]+[winfo rooty .]" + wm transient $top . + } + + label $w.header -text [mc "Add New Tool Command"] -font font_uibold + pack $w.header -side top -fill x + + frame $w.buttons + checkbutton $w.buttons.global \ + -text [mc "Add globally"] \ + -variable @add_global + pack $w.buttons.global -side left -padx 5 + button $w.buttons.create -text [mc Add] \ + -default active \ + -command [cb _add] + pack $w.buttons.create -side right + button $w.buttons.cancel -text [mc Cancel] \ + -command [list destroy $w] + pack $w.buttons.cancel -side right -padx 5 + pack $w.buttons -side bottom -fill x -pady 10 -padx 10 + + labelframe $w.desc -text [mc "Tool Details"] + + label $w.desc.name_cmnt -anchor w\ + -text [mc "Use '/' separators to create a submenu tree:"] + grid x $w.desc.name_cmnt -sticky we -padx {0 5} -pady {0 2} + label $w.desc.name_l -text [mc "Name:"] + set w_name $w.desc.name_t + entry $w_name \ + -borderwidth 1 \ + -relief sunken \ + -width 40 \ + -textvariable @name \ + -validate key \ + -validatecommand [cb _validate_name %d %S] + grid $w.desc.name_l $w_name -sticky we -padx {0 5} + + label $w.desc.cmd_l -text [mc "Command:"] + set w_cmd $w.desc.cmd_t + entry $w_cmd \ + -borderwidth 1 \ + -relief sunken \ + -width 40 \ + -textvariable @command + grid $w.desc.cmd_l $w_cmd -sticky we -padx {0 5} -pady {0 3} + + grid columnconfigure $w.desc 1 -weight 1 + pack $w.desc -anchor nw -fill x -pady 5 -padx 5 + + checkbutton $w.confirm \ + -text [mc "Show a dialog before running"] \ + -variable @confirm -command [cb _check_enable_dlg] + + labelframe $w.dlg -labelwidget $w.confirm + + checkbutton $w.dlg.askbranch \ + -text [mc "Ask the user to select a revision (sets \$REVISION)"] \ + -variable @ask_branch -state disabled + pack $w.dlg.askbranch -anchor w -padx 15 + + checkbutton $w.dlg.askargs \ + -text [mc "Ask the user for additional arguments (sets \$ARGS)"] \ + -variable @ask_args -state disabled + pack $w.dlg.askargs -anchor w -padx 15 + + pack $w.dlg -anchor nw -fill x -pady {0 8} -padx 5 + + checkbutton $w.noconsole \ + -text [mc "Don't show the command output window"] \ + -variable @no_console + pack $w.noconsole -anchor w -padx 5 + + checkbutton $w.needsfile \ + -text [mc "Run only if a diff is selected (\$FILENAME not empty)"] \ + -variable @needs_file + pack $w.needsfile -anchor w -padx 5 + + bind $w <Visibility> [cb _visible] + bind $w <Key-Escape> [list destroy $w] + bind $w <Key-Return> [cb _add]\;break + tkwait window $w +} + +method _check_enable_dlg {} { + if {$confirm} { + $w.dlg.askbranch configure -state normal + $w.dlg.askargs configure -state normal + } else { + $w.dlg.askbranch configure -state disabled + $w.dlg.askargs configure -state disabled + } +} + +method _add {} { + global repo_config + + if {$name eq {}} { + error_popup [mc "Please supply a name for the tool."] + focus $w_name + return + } + + set item "guitool.$name.cmd" + + if {[info exists repo_config($item)]} { + error_popup [mc "Tool '%s' already exists." $name] + focus $w_name + return + } + + set cmd [list git config] + if {$add_global} { lappend cmd --global } + set items {} + if {$no_console} { lappend items "guitool.$name.noconsole" } + if {$needs_file} { lappend items "guitool.$name.needsfile" } + if {$confirm} { + if {$ask_args} { lappend items "guitool.$name.argprompt" } + if {$ask_branch} { lappend items "guitool.$name.revprompt" } + if {!$ask_args && !$ask_branch} { + lappend items "guitool.$name.confirm" + } + } + + if {[catch { + eval $cmd [list $item $command] + foreach citem $items { eval $cmd [list $citem yes] } + } err]} { + error_popup [mc "Could not add tool:\n%s" $err] + } else { + set repo_config($item) $command + foreach citem $items { set repo_config($citem) yes } + + tools_populate_all + } + + destroy $w +} + +method _validate_name {d S} { + if {$d == 1} { + if {[regexp {[~?*&\[\0\"\\\{]} $S]} { + return 0 + } + } + return 1 +} + +method _visible {} { + grab $w + $w_name icursor end + focus $w_name +} + +} + +class tools_remove { + +field w ; # widget path +field w_names ; # name list + +constructor dialog {} { + global repo_config global_config system_config + + load_config 1 + + make_toplevel top w + wm title $top [append "[appname] ([reponame]): " [mc "Remove Tool"]] + if {$top ne {.}} { + wm geometry $top "+[winfo rootx .]+[winfo rooty .]" + wm transient $top . + } + + label $w.header -text [mc "Remove Tool Commands"] -font font_uibold + pack $w.header -side top -fill x + + frame $w.buttons + button $w.buttons.create -text [mc Remove] \ + -default active \ + -command [cb _remove] + pack $w.buttons.create -side right + button $w.buttons.cancel -text [mc Cancel] \ + -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.list + set w_names $w.list.l + listbox $w_names \ + -height 10 \ + -width 30 \ + -selectmode extended \ + -exportselection false \ + -yscrollcommand [list $w.list.sby set] + scrollbar $w.list.sby -command [list $w.list.l yview] + pack $w.list.sby -side right -fill y + pack $w.list.l -side left -fill both -expand 1 + pack $w.list -fill both -expand 1 -pady 5 -padx 5 + + set local_cnt 0 + foreach fullname [tools_list] { + # Cannot delete system tools + if {[info exists system_config(guitool.$fullname.cmd)]} continue + + $w_names insert end $fullname + if {![info exists global_config(guitool.$fullname.cmd)]} { + $w_names itemconfigure end -foreground blue + incr local_cnt + } + } + + if {$local_cnt > 0} { + label $w.colorlbl -foreground blue \ + -text [mc "(Blue denotes repository-local tools)"] + pack $w.colorlbl -fill x -pady 5 -padx 5 + } + + bind $w <Visibility> [cb _visible] + bind $w <Key-Escape> [list destroy $w] + bind $w <Key-Return> [cb _remove]\;break + tkwait window $w +} + +method _remove {} { + foreach i [$w_names curselection] { + set name [$w_names get $i] + + catch { git config --remove-section guitool.$name } + catch { git config --global --remove-section guitool.$name } + } + + load_config 0 + tools_populate_all + + destroy $w +} + +method _visible {} { + grab $w + focus $w_names +} + +} + +class tools_askdlg { + +field w ; # widget path +field w_rev {}; # revision browser +field w_args {}; # arguments + +field is_ask_args 0; # has arguments field +field is_ask_revs 0; # has revision browser + +field is_ok 0; # ok to start +field argstr {}; # arguments + +constructor dialog {fullname} { + global M1B + + set title [get_config "guitool.$fullname.title"] + if {$title eq {}} { + regsub {/} $fullname { / } title + } + + make_toplevel top w -autodelete 0 + wm title $top [append "[appname] ([reponame]): " $title] + if {$top ne {.}} { + wm geometry $top "+[winfo rootx .]+[winfo rooty .]" + wm transient $top . + } + + set prompt [get_config "guitool.$fullname.prompt"] + if {$prompt eq {}} { + set command [get_config "guitool.$fullname.cmd"] + set prompt [mc "Run Command: %s" $command] + } + + label $w.header -text $prompt -font font_uibold + pack $w.header -side top -fill x + + set argprompt [get_config "guitool.$fullname.argprompt"] + set revprompt [get_config "guitool.$fullname.revprompt"] + + set is_ask_args [expr {$argprompt ne {}}] + set is_ask_revs [expr {$revprompt ne {}}] + + if {$is_ask_args} { + if {$argprompt eq {yes} || $argprompt eq {true} || $argprompt eq {1}} { + set argprompt [mc "Arguments"] + } + + labelframe $w.arg -text $argprompt + + set w_args $w.arg.txt + entry $w_args \ + -borderwidth 1 \ + -relief sunken \ + -width 40 \ + -textvariable @argstr + pack $w_args -padx 5 -pady 5 -fill both + pack $w.arg -anchor nw -fill both -pady 5 -padx 5 + } + + if {$is_ask_revs} { + if {$revprompt eq {yes} || $revprompt eq {true} || $revprompt eq {1}} { + set revprompt [mc "Revision"] + } + + if {[is_config_true "guitool.$fullname.revunmerged"]} { + set w_rev [::choose_rev::new_unmerged $w.rev $revprompt] + } else { + set w_rev [::choose_rev::new $w.rev $revprompt] + } + + pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5 + } + + frame $w.buttons + if {$is_ask_revs} { + button $w.buttons.visualize \ + -text [mc Visualize] \ + -command [cb _visualize] + pack $w.buttons.visualize -side left + } + button $w.buttons.ok \ + -text [mc OK] \ + -command [cb _start] + pack $w.buttons.ok -side right + button $w.buttons.cancel \ + -text [mc "Cancel"] \ + -command [cb _cancel] + pack $w.buttons.cancel -side right -padx 5 + pack $w.buttons -side bottom -fill x -pady 10 -padx 10 + + bind $w <$M1B-Key-Return> [cb _start] + bind $w <Key-Return> [cb _start] + bind $w <Key-Escape> [cb _cancel] + wm protocol $w WM_DELETE_WINDOW [cb _cancel] + + bind $w <Visibility> [cb _visible] + return $this +} + +method execute {} { + tkwait window $w + set rv $is_ok + delete_this + return $rv +} + +method _visible {} { + grab $w + if {$is_ask_args} { + focus $w_args + } elseif {$is_ask_revs} { + $w_rev focus_filter + } +} + +method _cancel {} { + wm protocol $w WM_DELETE_WINDOW {} + destroy $w +} + +method _rev {} { + if {[catch {$w_rev commit_or_die}]} { + return {} + } + return [$w_rev get] +} + +method _visualize {} { + global current_branch + set rev [_rev $this] + if {$rev ne {}} { + do_gitk [list --left-right "$current_branch...$rev"] + } +} + +method _start {} { + global env + + if {$is_ask_revs} { + set name [_rev $this] + if {$name eq {}} { + return + } + set env(REVISION) $name + } + + if {$is_ask_args} { + set env(ARGS) $argstr + } + + set is_ok 1 + _cancel $this +} + +} diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl index 8e6a9d0a6..e419d7810 100644 --- a/git-gui/lib/transport.tcl +++ b/git-gui/lib/transport.tcl @@ -135,7 +135,7 @@ proc do_push_anywhere {} { set push_urltype url } radiobutton $w.dest.url_r \ - -text [mc "Arbitrary URL:"] \ + -text [mc "Arbitrary Location:"] \ -value url \ -variable push_urltype entry $w.dest.url_t \ diff --git a/git-gui/po/de.po b/git-gui/po/de.po index fa43947ad..5c04812b1 100644 --- a/git-gui/po/de.po +++ b/git-gui/po/de.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: git-gui\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-02 08:58+0200\n" -"PO-Revision-Date: 2008-08-02 09:09+0200\n" +"POT-Creation-Date: 2008-10-25 13:32+0200\n" +"PO-Revision-Date: 2008-10-25 22:47+0200\n" "Last-Translator: Christian Stimming <stimming@tuhh.de>\n" "Language-Team: German\n" "MIME-Version: 1.0\n" @@ -86,7 +86,17 @@ msgstr "Dateistatus aktualisieren..." msgid "Scanning for modified files ..." msgstr "Nach geänderten Dateien suchen..." -#: git-gui.sh:1324 lib/browser.tcl:246 +#: git-gui.sh:1325 +#, fuzzy +msgid "Calling prepare-commit-msg hook..." +msgstr "Aufrufen der Vor-Eintragen-Kontrolle..." + +#: git-gui.sh:1342 +#, fuzzy +msgid "Commit declined by prepare-commit-msg hook." +msgstr "Eintragen abgelehnt durch Vor-Eintragen-Kontrolle (»pre-commit hook«)." + +#: git-gui.sh:1502 lib/browser.tcl:246 msgid "Ready." msgstr "Bereit." @@ -110,7 +120,15 @@ msgstr "Teilweise bereitgestellt zum Eintragen" msgid "Staged for commit, missing" msgstr "Bereitgestellt zum Eintragen, fehlend" -#: git-gui.sh:1597 +#: git-gui.sh:1658 +msgid "File type changed, not staged" +msgstr "Dateityp geändert, nicht bereitgestellt" + +#: git-gui.sh:1659 +msgid "File type changed, staged" +msgstr "Dateityp geändert, bereitgestellt" + +#: git-gui.sh:1661 msgid "Untracked, not staged" msgstr "Nicht unter Versionskontrolle, nicht bereitgestellt" @@ -162,7 +180,11 @@ msgstr "Zusammenführen" msgid "Remote" msgstr "Andere Archive" -#: git-gui.sh:1879 +#: git-gui.sh:2242 +msgid "Explore Working Copy" +msgstr "Arbeitskopie im Dateimanager" + +#: git-gui.sh:2247 msgid "Browse Current Branch's Files" msgstr "Aktuellen Zweig durchblättern" @@ -259,7 +281,15 @@ msgstr "Löschen..." msgid "Reset..." msgstr "Zurücksetzen..." -#: git-gui.sh:2002 git-gui.sh:2389 +#: git-gui.sh:2372 +msgid "Done" +msgstr "Fertig" + +#: git-gui.sh:2374 +msgid "Commit@@verb" +msgstr "Eintragen" + +#: git-gui.sh:2383 git-gui.sh:2786 msgid "New Commit" msgstr "Neue Version" @@ -299,11 +329,7 @@ msgstr "Mehr Zeilen anzeigen" msgid "Sign Off" msgstr "Abzeichnen" -#: git-gui.sh:2053 git-gui.sh:2372 -msgid "Commit@@verb" -msgstr "Eintragen" - -#: git-gui.sh:2064 +#: git-gui.sh:2458 msgid "Local Merge..." msgstr "Lokales Zusammenführen..." @@ -311,11 +337,19 @@ msgstr "Lokales Zusammenführen..." msgid "Abort Merge..." msgstr "Zusammenführen abbrechen..." -#: git-gui.sh:2081 +#: git-gui.sh:2475 +msgid "Add..." +msgstr "Hinzufügen..." + +#: git-gui.sh:2479 msgid "Push..." msgstr "Versenden..." -#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14 +#: git-gui.sh:2483 +msgid "Delete Branch..." +msgstr "Zweig löschen..." + +#: git-gui.sh:2493 git-gui.sh:2515 lib/about.tcl:14 #: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50 #, tcl-format msgid "About %s" @@ -396,15 +430,7 @@ msgstr "Alle kopieren" msgid "File:" msgstr "Datei:" -#: git-gui.sh:2589 -msgid "Apply/Reverse Hunk" -msgstr "Kontext anwenden/umkehren" - -#: git-gui.sh:2696 -msgid "Apply/Reverse Line" -msgstr "Zeile anwenden/umkehren" - -#: git-gui.sh:2711 +#: git-gui.sh:2834 msgid "Refresh" msgstr "Aktualisieren" @@ -416,7 +442,35 @@ msgstr "Schriftgröße verkleinern" msgid "Increase Font Size" msgstr "Schriftgröße vergrößern" -#: git-gui.sh:2646 +#: git-gui.sh:3033 lib/blame.tcl:281 +msgid "Encoding" +msgstr "Zeichenkodierung" + +#: git-gui.sh:3044 +msgid "Apply/Reverse Hunk" +msgstr "Kontext anwenden/umkehren" + +#: git-gui.sh:2875 +msgid "Apply/Reverse Line" +msgstr "Zeile anwenden/umkehren" + +#: git-gui.sh:2885 +msgid "Run Merge Tool" +msgstr "Zusammenführungswerkzeug" + +#: git-gui.sh:2890 +msgid "Use Remote Version" +msgstr "Entfernte Version benutzen" + +#: git-gui.sh:2894 +msgid "Use Local Version" +msgstr "Lokale Version benutzen" + +#: git-gui.sh:2898 +msgid "Revert To Base" +msgstr "Ursprüngliche Version benutzen" + +#: git-gui.sh:3091 msgid "Unstage Hunk From Commit" msgstr "Kontext aus Bereitstellung herausnehmen" @@ -498,7 +552,15 @@ msgstr "Version kopieren" msgid "Do Full Copy Detection" msgstr "Volle Kopie-Erkennung" -#: lib/blame.tcl:388 +#: lib/blame.tcl:263 +msgid "Show History Context" +msgstr "Historien-Kontext anzeigen" + +#: lib/blame.tcl:266 +msgid "Blame Parent Commit" +msgstr "Elternversion annotieren" + +#: lib/blame.tcl:394 #, tcl-format msgid "Reading %s..." msgstr "%s lesen..." @@ -547,7 +609,24 @@ msgstr "Eintragender:" msgid "Original File:" msgstr "Ursprüngliche Datei:" -#: lib/blame.tcl:925 +#: lib/blame.tcl:1013 +#, fuzzy +msgid "Cannot find HEAD commit:" +msgstr "Elternversion kann nicht gefunden werden:" + +#: lib/blame.tcl:1068 +msgid "Cannot find parent commit:" +msgstr "Elternversion kann nicht gefunden werden:" + +#: lib/blame.tcl:1001 +msgid "Unable to display parent" +msgstr "Elternversion kann nicht angezeigt werden" + +#: lib/blame.tcl:1002 lib/diff.tcl:191 +msgid "Error loading diff:" +msgstr "Fehler beim Laden des Vergleichs:" + +#: lib/blame.tcl:1142 msgid "Originally By:" msgstr "Ursprünglich von:" @@ -993,11 +1072,15 @@ msgstr "Datei »%s« existiert bereits." msgid "Clone" msgstr "Klonen" -#: lib/choose_repository.tcl:468 -msgid "URL:" -msgstr "URL:" +#: lib/choose_repository.tcl:467 +msgid "Source Location:" +msgstr "" + +#: lib/choose_repository.tcl:478 +msgid "Target Directory:" +msgstr "Zielverzeichnis:" -#: lib/choose_repository.tcl:489 +#: lib/choose_repository.tcl:490 msgid "Clone Type:" msgstr "Art des Klonens:" @@ -1477,7 +1560,27 @@ msgstr "" msgid "Loading diff of %s..." msgstr "Vergleich von »%s« laden..." -#: lib/diff.tcl:114 lib/diff.tcl:184 +#: lib/diff.tcl:120 +msgid "" +"LOCAL: deleted\n" +"REMOTE:\n" +msgstr "" + +#: lib/diff.tcl:125 +msgid "" +"REMOTE: deleted\n" +"LOCAL:\n" +msgstr "" + +#: lib/diff.tcl:132 +msgid "LOCAL:\n" +msgstr "" + +#: lib/diff.tcl:135 +msgid "REMOTE:\n" +msgstr "" + +#: lib/diff.tcl:197 lib/diff.tcl:296 #, tcl-format msgid "Unable to display %s" msgstr "Datei »%s« kann nicht angezeigt werden" @@ -1494,11 +1597,22 @@ msgstr "Git-Projektarchiv (Unterprojekt)" msgid "* Binary file (not showing content)." msgstr "* Binärdatei (Inhalt wird nicht angezeigt)" -#: lib/diff.tcl:185 -msgid "Error loading diff:" -msgstr "Fehler beim Laden des Vergleichs:" +#: lib/diff.tcl:222 +#, tcl-format +msgid "" +"* Untracked file is %d bytes.\n" +"* Showing only first %d bytes.\n" +msgstr "" -#: lib/diff.tcl:303 +#: lib/diff.tcl:228 +#, tcl-format +msgid "" +"\n" +"* Untracked file clipped here by %s.\n" +"* To see the entire file, use an external editor.\n" +msgstr "" + +#: lib/diff.tcl:437 msgid "Failed to unstage selected hunk." msgstr "" "Fehler beim Herausnehmen des gewählten Kontexts aus der Bereitstellung." @@ -1515,6 +1629,19 @@ msgstr "Fehler beim Herausnehmen der gewählten Zeile aus der Bereitstellung." msgid "Failed to stage selected line." msgstr "Fehler beim Bereitstellen der gewählten Zeile." +#: lib/encoding.tcl:443 +msgid "Default" +msgstr "Voreinstellung" + +#: lib/encoding.tcl:448 +#, tcl-format +msgid "System (%s)" +msgstr "Systemweit (%s)" + +#: lib/encoding.tcl:459 lib/encoding.tcl:465 +msgid "Other" +msgstr "Andere" + #: lib/error.tcl:20 lib/error.tcl:114 msgid "error" msgstr "Fehler" @@ -1586,6 +1713,15 @@ msgstr "" msgid "Do Nothing" msgstr "Nichts tun" +#: lib/index.tcl:419 +msgid "Reverting selected files" +msgstr "Änderungen in gewählten Dateien verwerfen" + +#: lib/index.tcl:423 +#, tcl-format +msgid "Reverting %s" +msgstr "Änderungen in %s verwerfen" + #: lib/merge.tcl:13 msgid "" "Cannot merge while amending.\n" @@ -1730,7 +1866,107 @@ msgstr "Abbruch fehlgeschlagen." msgid "Abort completed. Ready." msgstr "Abbruch durchgeführt. Bereit." -#: lib/option.tcl:95 +#: lib/mergetool.tcl:14 +msgid "Force resolution to the base version?" +msgstr "Konflikt durch Basisversion ersetzen?" + +#: lib/mergetool.tcl:15 +msgid "Force resolution to this branch?" +msgstr "Konflikt durch diesen Zweig ersetzen?" + +#: lib/mergetool.tcl:16 +msgid "Force resolution to the other branch?" +msgstr "Konflikt durch anderen Zweig ersetzen?" + +#: lib/mergetool.tcl:20 +#, tcl-format +msgid "" +"Note that the diff shows only conflicting changes.\n" +"\n" +"%s will be overwritten.\n" +"\n" +"This operation can be undone only by restarting the merge." +msgstr "" +"Hinweis: Der Vergleich zeigt nur konfliktverursachende Änderungen an.\n" +"\n" +"»%s« wird überschrieben.\n" +"\n" +"Diese Operation kann nur rückgängig gemacht werden, wenn die\n" +"Zusammenführung erneut gestartet wird." + +#: lib/mergetool.tcl:45 +#, tcl-format +msgid "File %s seems to have unresolved conflicts, still stage?" +msgstr "Datei »%s« hat nicht aufgelöste Konflikte. Trotzdem bereitstellen?" + +#: lib/mergetool.tcl:60 +#, tcl-format +msgid "Adding resolution for %s" +msgstr "Auflösung hinzugefügt für %s" + +#: lib/mergetool.tcl:119 +msgid "Cannot resolve deletion or link conflicts using a tool" +msgstr "" +"Konflikte durch gelöschte Dateien oder symbolische Links können nicht durch " +"das Zusamenführungswerkzeug gelöst werden." + +#: lib/mergetool.tcl:124 +msgid "Conflict file does not exist" +msgstr "Konflikt-Datei existiert nicht" + +#: lib/mergetool.tcl:236 +#, tcl-format +msgid "Not a GUI merge tool: '%s'" +msgstr "Kein GUI Zusammenführungswerkzeug: »%s«" + +#: lib/mergetool.tcl:240 +#, tcl-format +msgid "Unsupported merge tool '%s'" +msgstr "Unbekanntes Zusammenführungswerkzeug: »%s«" + +#: lib/mergetool.tcl:275 +msgid "Merge tool is already running, terminate it?" +msgstr "Zusammenführungswerkzeug läuft bereits. Soll es abgebrochen werden?" + +#: lib/mergetool.tcl:295 +#, tcl-format +msgid "" +"Error retrieving versions:\n" +"%s" +msgstr "" +"Fehler beim Abrufen der Dateiversionen:\n" +"%s" + +#: lib/mergetool.tcl:315 +#, tcl-format +msgid "" +"Could not start the merge tool:\n" +"\n" +"%s" +msgstr "" +"Zusammenführungswerkzeug konnte nicht gestartet werden:\n" +"\n" +"%s" + +#: lib/mergetool.tcl:319 +msgid "Running merge tool..." +msgstr "Zusammenführungswerkzeug starten..." + +#: lib/mergetool.tcl:347 lib/mergetool.tcl:363 +msgid "Merge tool failed." +msgstr "Zusammenführungswerkzeug fehlgeschlagen." + +#: lib/option.tcl:11 +#, tcl-format +msgid "Invalid global encoding '%s'" +msgstr "Ungültige globale Zeichenkodierung »%s«" + +#: lib/option.tcl:19 +#, tcl-format +msgid "Invalid repo encoding '%s'" +msgstr "Ungültige Archiv-Zeichenkodierung »%s«" + +#: lib/option.tcl:117 msgid "Restore Defaults" msgstr "Voreinstellungen wiederherstellen" @@ -1767,7 +2003,11 @@ msgstr "Ausführlichkeit der Zusammenführen-Meldungen" msgid "Show Diffstat After Merge" msgstr "Vergleichsstatistik nach Zusammenführen anzeigen" -#: lib/option.tcl:123 +#: lib/option.tcl:122 +msgid "Use Merge Tool" +msgstr "Zusammenführungswerkzeug" + +#: lib/option.tcl:124 msgid "Trust File Modification Timestamps" msgstr "Auf Dateiänderungsdatum verlassen" @@ -1788,6 +2028,10 @@ msgid "Minimum Letters To Blame Copy On" msgstr "Mindestzahl Zeichen für Kopie-Annotieren" #: lib/option.tcl:128 +msgid "Blame History Context Radius (days)" +msgstr "Anzahl Tage für Historien-Kontext" + +#: lib/option.tcl:129 msgid "Number of Diff Context Lines" msgstr "Anzahl der Kontextzeilen beim Vergleich" @@ -1799,7 +2043,15 @@ msgstr "Textbreite der Versionsbeschreibung" msgid "New Branch Name Template" msgstr "Namensvorschlag für neue Zweige" -#: lib/option.tcl:192 +#: lib/option.tcl:155 +msgid "Default File Contents Encoding" +msgstr "Vorgestellte Zeichenkodierung" + +#: lib/option.tcl:203 +msgid "Change" +msgstr "Ändern" + +#: lib/option.tcl:230 msgid "Spelling Dictionary:" msgstr "Wörterbuch Rechtschreibprüfung:" @@ -1824,9 +2076,85 @@ msgstr "Einstellungen" msgid "Failed to completely save options:" msgstr "Optionen konnten nicht gespeichert werden:" +#: lib/remote_add.tcl:19 +msgid "Add Remote" +msgstr "Anderes Archiv hinzufügen" + +#: lib/remote_add.tcl:24 +msgid "Add New Remote" +msgstr "Neues anderes Archiv hinzufügen" + +#: lib/remote_add.tcl:28 +msgid "Add" +msgstr "Hinzufügen" + +#: lib/remote_add.tcl:37 +msgid "Remote Details" +msgstr "Einzelheiten des anderen Archivs" + +#: lib/remote_add.tcl:50 +msgid "Location:" +msgstr "Adresse:" + +#: lib/remote_add.tcl:62 +msgid "Further Action" +msgstr "Weitere Aktion jetzt" + +#: lib/remote_add.tcl:65 +msgid "Fetch Immediately" +msgstr "Gleich anfordern" + +#: lib/remote_add.tcl:71 +msgid "Initialize Remote Repository and Push" +msgstr "Anderes Archiv initialisieren und dahin versenden" + +#: lib/remote_add.tcl:77 +msgid "Do Nothing Else Now" +msgstr "Nichts tun" + +#: lib/remote_add.tcl:101 +#, fuzzy +msgid "Please supply a remote name." +msgstr "Bitte geben Sie einen Zweignamen an." + +#: lib/remote_add.tcl:114 +#, fuzzy, tcl-format +msgid "'%s' is not an acceptable remote name." +msgstr "»%s« ist kein zulässiger Zweigname." + +#: lib/remote_add.tcl:125 +#, fuzzy, tcl-format +msgid "Failed to add remote '%s' of location '%s'." +msgstr "Fehler beim Umbenennen von »%s«." + +#: lib/remote_add.tcl:133 lib/transport.tcl:6 +#, tcl-format +msgid "fetch %s" +msgstr "»%s« anfordern" + +#: lib/remote_add.tcl:134 +#, fuzzy, tcl-format +msgid "Fetching the %s" +msgstr "Änderungen »%s« von »%s« anfordern" + +#: lib/remote_add.tcl:157 +#, tcl-format +msgid "Do not know how to initialize repository at location '%s'." +msgstr "Initialisieren eines anderen Archivs an Adresse »%s« ist nicht möglich." + +#: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:71 +#, tcl-format +msgid "push %s" +msgstr "»%s« versenden..." + +#: lib/remote_add.tcl:164 +#, tcl-format +msgid "Setting up the %s (at %s)" +msgstr "Einrichten von »%s« an »%s«" + #: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34 -msgid "Delete Remote Branch" -msgstr "Zweig in anderem Projektarchiv löschen" +msgid "Delete Branch Remotely" +msgstr "Zweig in anderem Archiv löschen" #: lib/remote_branch_delete.tcl:47 msgid "From Repository" @@ -1837,8 +2165,8 @@ msgid "Remote:" msgstr "Anderes Archiv:" #: lib/remote_branch_delete.tcl:66 lib/transport.tcl:138 -msgid "Arbitrary URL:" -msgstr "Archiv-URL:" +msgid "Arbitrary Location:" +msgstr "Adresse:" #: lib/remote_branch_delete.tcl:84 msgid "Branches" @@ -1910,7 +2238,11 @@ msgstr "Kein Projektarchiv ausgewählt." msgid "Scanning %s..." msgstr "»%s« laden..." -#: lib/remote.tcl:165 +#: lib/remote.tcl:163 +msgid "Remove Remote" +msgstr "Anderes Archiv entfernen" + +#: lib/remote.tcl:168 msgid "Prune from" msgstr "Aufräumen von" @@ -1922,6 +2254,22 @@ msgstr "Anfordern von" msgid "Push to" msgstr "Versenden nach" +#: lib/search.tcl:21 +msgid "Find:" +msgstr "Suchen:" + +#: lib/search.tcl:22 +msgid "Next" +msgstr "Nächster" + +#: lib/search.tcl:23 +msgid "Prev" +msgstr "Voriger" + +#: lib/search.tcl:24 +msgid "Case-Sensitive" +msgstr "" + #: lib/shortcut.tcl:20 lib/shortcut.tcl:61 msgid "Cannot write shortcut:" msgstr "Fehler beim Schreiben der Verknüpfung:" @@ -1972,11 +2320,6 @@ msgstr "Rechtschreibprüfung fehlgeschlagen" msgid "%s ... %*i of %*i %s (%3i%%)" msgstr "%s ... %*i von %*i %s (%3i%%)" -#: lib/transport.tcl:6 -#, tcl-format -msgid "fetch %s" -msgstr "»%s« anfordern" - #: lib/transport.tcl:7 #, tcl-format msgid "Fetching new changes from %s" @@ -1992,11 +2335,6 @@ msgstr "Aufräumen von »%s«" msgid "Pruning tracking branches deleted from %s" msgstr "Übernahmezweige aufräumen und entfernen, die in »%s« gelöscht wurden" -#: lib/transport.tcl:25 lib/transport.tcl:71 -#, tcl-format -msgid "push %s" -msgstr "»%s« versenden..." - #: lib/transport.tcl:26 #, tcl-format msgid "Pushing changes to %s" diff --git a/git-gui/po/git-gui.pot b/git-gui/po/git-gui.pot index e295000e7..58db67c21 100644 --- a/git-gui/po/git-gui.pot +++ b/git-gui/po/git-gui.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-02 14:45-0700\n" +"POT-Creation-Date: 2008-11-16 13:56-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,33 +16,33 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: git-gui.sh:41 git-gui.sh:688 git-gui.sh:702 git-gui.sh:715 git-gui.sh:798 -#: git-gui.sh:817 +#: git-gui.sh:41 git-gui.sh:737 git-gui.sh:751 git-gui.sh:764 git-gui.sh:847 +#: git-gui.sh:866 msgid "git-gui: fatal error" msgstr "" -#: git-gui.sh:644 +#: git-gui.sh:689 #, tcl-format msgid "Invalid font specified in %s:" msgstr "" -#: git-gui.sh:674 +#: git-gui.sh:723 msgid "Main Font" msgstr "" -#: git-gui.sh:675 +#: git-gui.sh:724 msgid "Diff/Console Font" msgstr "" -#: git-gui.sh:689 +#: git-gui.sh:738 msgid "Cannot find git in PATH." msgstr "" -#: git-gui.sh:716 +#: git-gui.sh:765 msgid "Cannot parse Git version string:" msgstr "" -#: git-gui.sh:734 +#: git-gui.sh:783 #, tcl-format msgid "" "Git version cannot be determined.\n" @@ -54,379 +54,444 @@ msgid "" "Assume '%s' is version 1.5.0?\n" msgstr "" -#: git-gui.sh:972 +#: git-gui.sh:1062 msgid "Git directory not found:" msgstr "" -#: git-gui.sh:979 +#: git-gui.sh:1069 msgid "Cannot move to top of working directory:" msgstr "" -#: git-gui.sh:986 +#: git-gui.sh:1076 msgid "Cannot use funny .git directory:" msgstr "" -#: git-gui.sh:991 +#: git-gui.sh:1081 msgid "No working directory" msgstr "" -#: git-gui.sh:1138 lib/checkout_op.tcl:305 +#: git-gui.sh:1247 lib/checkout_op.tcl:305 msgid "Refreshing file status..." msgstr "" -#: git-gui.sh:1194 +#: git-gui.sh:1303 msgid "Scanning for modified files ..." msgstr "" -#: git-gui.sh:1369 lib/browser.tcl:246 +#: git-gui.sh:1367 +msgid "Calling prepare-commit-msg hook..." +msgstr "" + +#: git-gui.sh:1384 +msgid "Commit declined by prepare-commit-msg hook." +msgstr "" + +#: git-gui.sh:1542 lib/browser.tcl:246 msgid "Ready." msgstr "" -#: git-gui.sh:1635 +#: git-gui.sh:1819 msgid "Unmodified" msgstr "" -#: git-gui.sh:1637 +#: git-gui.sh:1821 msgid "Modified, not staged" msgstr "" -#: git-gui.sh:1638 git-gui.sh:1643 +#: git-gui.sh:1822 git-gui.sh:1830 msgid "Staged for commit" msgstr "" -#: git-gui.sh:1639 git-gui.sh:1644 +#: git-gui.sh:1823 git-gui.sh:1831 msgid "Portions staged for commit" msgstr "" -#: git-gui.sh:1640 git-gui.sh:1645 +#: git-gui.sh:1824 git-gui.sh:1832 msgid "Staged for commit, missing" msgstr "" -#: git-gui.sh:1642 +#: git-gui.sh:1826 +msgid "File type changed, not staged" +msgstr "" + +#: git-gui.sh:1827 +msgid "File type changed, staged" +msgstr "" + +#: git-gui.sh:1829 msgid "Untracked, not staged" msgstr "" -#: git-gui.sh:1647 +#: git-gui.sh:1834 msgid "Missing" msgstr "" -#: git-gui.sh:1648 +#: git-gui.sh:1835 msgid "Staged for removal" msgstr "" -#: git-gui.sh:1649 +#: git-gui.sh:1836 msgid "Staged for removal, still present" msgstr "" -#: git-gui.sh:1651 git-gui.sh:1652 git-gui.sh:1653 git-gui.sh:1654 +#: git-gui.sh:1838 git-gui.sh:1839 git-gui.sh:1840 git-gui.sh:1841 +#: git-gui.sh:1842 git-gui.sh:1843 msgid "Requires merge resolution" msgstr "" -#: git-gui.sh:1689 +#: git-gui.sh:1878 msgid "Starting gitk... please wait..." msgstr "" -#: git-gui.sh:1698 +#: git-gui.sh:1887 msgid "Couldn't find gitk in PATH" msgstr "" -#: git-gui.sh:1948 lib/choose_repository.tcl:36 +#: git-gui.sh:2280 lib/choose_repository.tcl:36 msgid "Repository" msgstr "" -#: git-gui.sh:1949 +#: git-gui.sh:2281 msgid "Edit" msgstr "" -#: git-gui.sh:1951 lib/choose_rev.tcl:561 +#: git-gui.sh:2283 lib/choose_rev.tcl:561 msgid "Branch" msgstr "" -#: git-gui.sh:1954 lib/choose_rev.tcl:548 +#: git-gui.sh:2286 lib/choose_rev.tcl:548 msgid "Commit@@noun" msgstr "" -#: git-gui.sh:1957 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167 +#: git-gui.sh:2289 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168 msgid "Merge" msgstr "" -#: git-gui.sh:1958 lib/choose_rev.tcl:557 +#: git-gui.sh:2290 lib/choose_rev.tcl:557 msgid "Remote" msgstr "" -#: git-gui.sh:1967 +#: git-gui.sh:2293 +msgid "Tools" +msgstr "" + +#: git-gui.sh:2302 +msgid "Explore Working Copy" +msgstr "" + +#: git-gui.sh:2307 msgid "Browse Current Branch's Files" msgstr "" -#: git-gui.sh:1971 +#: git-gui.sh:2311 msgid "Browse Branch Files..." msgstr "" -#: git-gui.sh:1976 +#: git-gui.sh:2316 msgid "Visualize Current Branch's History" msgstr "" -#: git-gui.sh:1980 +#: git-gui.sh:2320 msgid "Visualize All Branch History" msgstr "" -#: git-gui.sh:1987 +#: git-gui.sh:2327 #, tcl-format msgid "Browse %s's Files" msgstr "" -#: git-gui.sh:1989 +#: git-gui.sh:2329 #, tcl-format msgid "Visualize %s's History" msgstr "" -#: git-gui.sh:1994 lib/database.tcl:27 lib/database.tcl:67 +#: git-gui.sh:2334 lib/database.tcl:27 lib/database.tcl:67 msgid "Database Statistics" msgstr "" -#: git-gui.sh:1997 lib/database.tcl:34 +#: git-gui.sh:2337 lib/database.tcl:34 msgid "Compress Database" msgstr "" -#: git-gui.sh:2000 +#: git-gui.sh:2340 msgid "Verify Database" msgstr "" -#: git-gui.sh:2007 git-gui.sh:2011 git-gui.sh:2015 lib/shortcut.tcl:7 +#: git-gui.sh:2347 git-gui.sh:2351 git-gui.sh:2355 lib/shortcut.tcl:7 #: lib/shortcut.tcl:39 lib/shortcut.tcl:71 msgid "Create Desktop Icon" msgstr "" -#: git-gui.sh:2023 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185 +#: git-gui.sh:2363 lib/choose_repository.tcl:183 lib/choose_repository.tcl:191 msgid "Quit" msgstr "" -#: git-gui.sh:2031 +#: git-gui.sh:2371 msgid "Undo" msgstr "" -#: git-gui.sh:2034 +#: git-gui.sh:2374 msgid "Redo" msgstr "" -#: git-gui.sh:2038 git-gui.sh:2545 +#: git-gui.sh:2378 git-gui.sh:2923 msgid "Cut" msgstr "" -#: git-gui.sh:2041 git-gui.sh:2548 git-gui.sh:2622 git-gui.sh:2715 +#: git-gui.sh:2381 git-gui.sh:2926 git-gui.sh:3000 git-gui.sh:3082 #: lib/console.tcl:69 msgid "Copy" msgstr "" -#: git-gui.sh:2044 git-gui.sh:2551 +#: git-gui.sh:2384 git-gui.sh:2929 msgid "Paste" msgstr "" -#: git-gui.sh:2047 git-gui.sh:2554 lib/branch_delete.tcl:26 +#: git-gui.sh:2387 git-gui.sh:2932 lib/branch_delete.tcl:26 #: lib/remote_branch_delete.tcl:38 msgid "Delete" msgstr "" -#: git-gui.sh:2051 git-gui.sh:2558 git-gui.sh:2719 lib/console.tcl:71 +#: git-gui.sh:2391 git-gui.sh:2936 git-gui.sh:3086 lib/console.tcl:71 msgid "Select All" msgstr "" -#: git-gui.sh:2060 +#: git-gui.sh:2400 msgid "Create..." msgstr "" -#: git-gui.sh:2066 +#: git-gui.sh:2406 msgid "Checkout..." msgstr "" -#: git-gui.sh:2072 +#: git-gui.sh:2412 msgid "Rename..." msgstr "" -#: git-gui.sh:2077 git-gui.sh:2187 +#: git-gui.sh:2417 msgid "Delete..." msgstr "" -#: git-gui.sh:2082 +#: git-gui.sh:2422 msgid "Reset..." msgstr "" -#: git-gui.sh:2094 git-gui.sh:2491 +#: git-gui.sh:2432 +msgid "Done" +msgstr "" + +#: git-gui.sh:2434 +msgid "Commit@@verb" +msgstr "" + +#: git-gui.sh:2443 git-gui.sh:2864 msgid "New Commit" msgstr "" -#: git-gui.sh:2102 git-gui.sh:2498 +#: git-gui.sh:2451 git-gui.sh:2871 msgid "Amend Last Commit" msgstr "" -#: git-gui.sh:2111 git-gui.sh:2458 lib/remote_branch_delete.tcl:99 +#: git-gui.sh:2461 git-gui.sh:2825 lib/remote_branch_delete.tcl:99 msgid "Rescan" msgstr "" -#: git-gui.sh:2117 +#: git-gui.sh:2467 msgid "Stage To Commit" msgstr "" -#: git-gui.sh:2123 +#: git-gui.sh:2473 msgid "Stage Changed Files To Commit" msgstr "" -#: git-gui.sh:2129 +#: git-gui.sh:2479 msgid "Unstage From Commit" msgstr "" -#: git-gui.sh:2134 lib/index.tcl:395 +#: git-gui.sh:2484 lib/index.tcl:410 msgid "Revert Changes" msgstr "" -#: git-gui.sh:2141 git-gui.sh:2702 +#: git-gui.sh:2491 git-gui.sh:3069 msgid "Show Less Context" msgstr "" -#: git-gui.sh:2145 git-gui.sh:2706 +#: git-gui.sh:2495 git-gui.sh:3073 msgid "Show More Context" msgstr "" -#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569 +#: git-gui.sh:2502 git-gui.sh:2838 git-gui.sh:2947 msgid "Sign Off" msgstr "" -#: git-gui.sh:2155 git-gui.sh:2474 -msgid "Commit@@verb" -msgstr "" - -#: git-gui.sh:2166 +#: git-gui.sh:2518 msgid "Local Merge..." msgstr "" -#: git-gui.sh:2171 +#: git-gui.sh:2523 msgid "Abort Merge..." msgstr "" -#: git-gui.sh:2183 +#: git-gui.sh:2535 git-gui.sh:2575 +msgid "Add..." +msgstr "" + +#: git-gui.sh:2539 msgid "Push..." msgstr "" -#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14 -#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50 +#: git-gui.sh:2543 +msgid "Delete Branch..." +msgstr "" + +#: git-gui.sh:2553 git-gui.sh:2589 lib/about.tcl:14 +#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:53 #, tcl-format msgid "About %s" msgstr "" -#: git-gui.sh:2201 +#: git-gui.sh:2557 msgid "Preferences..." msgstr "" -#: git-gui.sh:2209 git-gui.sh:2740 +#: git-gui.sh:2565 git-gui.sh:3115 msgid "Options..." msgstr "" -#: git-gui.sh:2215 lib/choose_repository.tcl:47 +#: git-gui.sh:2576 +msgid "Remove..." +msgstr "" + +#: git-gui.sh:2585 lib/choose_repository.tcl:50 msgid "Help" msgstr "" -#: git-gui.sh:2256 +#: git-gui.sh:2611 msgid "Online Documentation" msgstr "" -#: git-gui.sh:2340 +#: git-gui.sh:2614 lib/choose_repository.tcl:47 lib/choose_repository.tcl:56 +msgid "Show SSH Key" +msgstr "" + +#: git-gui.sh:2707 #, tcl-format msgid "fatal: cannot stat path %s: No such file or directory" msgstr "" -#: git-gui.sh:2373 +#: git-gui.sh:2740 msgid "Current Branch:" msgstr "" -#: git-gui.sh:2394 +#: git-gui.sh:2761 msgid "Staged Changes (Will Commit)" msgstr "" -#: git-gui.sh:2414 +#: git-gui.sh:2781 msgid "Unstaged Changes" msgstr "" -#: git-gui.sh:2464 +#: git-gui.sh:2831 msgid "Stage Changed" msgstr "" -#: git-gui.sh:2480 lib/transport.tcl:93 lib/transport.tcl:182 +#: git-gui.sh:2850 lib/transport.tcl:93 lib/transport.tcl:182 msgid "Push" msgstr "" -#: git-gui.sh:2510 +#: git-gui.sh:2885 msgid "Initial Commit Message:" msgstr "" -#: git-gui.sh:2511 +#: git-gui.sh:2886 msgid "Amended Commit Message:" msgstr "" -#: git-gui.sh:2512 +#: git-gui.sh:2887 msgid "Amended Initial Commit Message:" msgstr "" -#: git-gui.sh:2513 +#: git-gui.sh:2888 msgid "Amended Merge Commit Message:" msgstr "" -#: git-gui.sh:2514 +#: git-gui.sh:2889 msgid "Merge Commit Message:" msgstr "" -#: git-gui.sh:2515 +#: git-gui.sh:2890 msgid "Commit Message:" msgstr "" -#: git-gui.sh:2561 git-gui.sh:2723 lib/console.tcl:73 +#: git-gui.sh:2939 git-gui.sh:3090 lib/console.tcl:73 msgid "Copy All" msgstr "" -#: git-gui.sh:2585 lib/blame.tcl:100 +#: git-gui.sh:2963 lib/blame.tcl:104 msgid "File:" msgstr "" -#: git-gui.sh:2691 +#: git-gui.sh:3078 +msgid "Refresh" +msgstr "" + +#: git-gui.sh:3099 +msgid "Decrease Font Size" +msgstr "" + +#: git-gui.sh:3103 +msgid "Increase Font Size" +msgstr "" + +#: git-gui.sh:3111 lib/blame.tcl:281 +msgid "Encoding" +msgstr "" + +#: git-gui.sh:3122 msgid "Apply/Reverse Hunk" msgstr "" -#: git-gui.sh:2696 +#: git-gui.sh:3127 msgid "Apply/Reverse Line" msgstr "" -#: git-gui.sh:2711 -msgid "Refresh" +#: git-gui.sh:3137 +msgid "Run Merge Tool" msgstr "" -#: git-gui.sh:2732 -msgid "Decrease Font Size" +#: git-gui.sh:3142 +msgid "Use Remote Version" msgstr "" -#: git-gui.sh:2736 -msgid "Increase Font Size" +#: git-gui.sh:3146 +msgid "Use Local Version" +msgstr "" + +#: git-gui.sh:3150 +msgid "Revert To Base" msgstr "" -#: git-gui.sh:2747 +#: git-gui.sh:3169 msgid "Unstage Hunk From Commit" msgstr "" -#: git-gui.sh:2748 +#: git-gui.sh:3170 msgid "Unstage Line From Commit" msgstr "" -#: git-gui.sh:2750 +#: git-gui.sh:3172 msgid "Stage Hunk For Commit" msgstr "" -#: git-gui.sh:2751 +#: git-gui.sh:3173 msgid "Stage Line For Commit" msgstr "" -#: git-gui.sh:2771 +#: git-gui.sh:3196 msgid "Initializing..." msgstr "" -#: git-gui.sh:2876 +#: git-gui.sh:3301 #, tcl-format msgid "" "Possible environment issues exist.\n" @@ -437,14 +502,14 @@ msgid "" "\n" msgstr "" -#: git-gui.sh:2906 +#: git-gui.sh:3331 msgid "" "\n" "This is due to a known issue with the\n" "Tcl binary distributed by Cygwin." msgstr "" -#: git-gui.sh:2911 +#: git-gui.sh:3336 #, tcl-format msgid "" "\n" @@ -459,80 +524,108 @@ msgstr "" msgid "git-gui - a graphical user interface for Git." msgstr "" -#: lib/blame.tcl:70 +#: lib/blame.tcl:72 msgid "File Viewer" msgstr "" -#: lib/blame.tcl:74 +#: lib/blame.tcl:78 msgid "Commit:" msgstr "" -#: lib/blame.tcl:257 +#: lib/blame.tcl:271 msgid "Copy Commit" msgstr "" -#: lib/blame.tcl:260 +#: lib/blame.tcl:275 +msgid "Find Text..." +msgstr "" + +#: lib/blame.tcl:284 msgid "Do Full Copy Detection" msgstr "" -#: lib/blame.tcl:388 +#: lib/blame.tcl:288 +msgid "Show History Context" +msgstr "" + +#: lib/blame.tcl:291 +msgid "Blame Parent Commit" +msgstr "" + +#: lib/blame.tcl:450 #, tcl-format msgid "Reading %s..." msgstr "" -#: lib/blame.tcl:492 +#: lib/blame.tcl:557 msgid "Loading copy/move tracking annotations..." msgstr "" -#: lib/blame.tcl:512 +#: lib/blame.tcl:577 msgid "lines annotated" msgstr "" -#: lib/blame.tcl:704 +#: lib/blame.tcl:769 msgid "Loading original location annotations..." msgstr "" -#: lib/blame.tcl:707 +#: lib/blame.tcl:772 msgid "Annotation complete." msgstr "" -#: lib/blame.tcl:737 +#: lib/blame.tcl:802 msgid "Busy" msgstr "" -#: lib/blame.tcl:738 +#: lib/blame.tcl:803 msgid "Annotation process is already running." msgstr "" -#: lib/blame.tcl:777 +#: lib/blame.tcl:842 msgid "Running thorough copy detection..." msgstr "" -#: lib/blame.tcl:827 +#: lib/blame.tcl:910 msgid "Loading annotation..." msgstr "" -#: lib/blame.tcl:883 +#: lib/blame.tcl:964 msgid "Author:" msgstr "" -#: lib/blame.tcl:887 +#: lib/blame.tcl:968 msgid "Committer:" msgstr "" -#: lib/blame.tcl:892 +#: lib/blame.tcl:973 msgid "Original File:" msgstr "" -#: lib/blame.tcl:1006 +#: lib/blame.tcl:1021 +msgid "Cannot find HEAD commit:" +msgstr "" + +#: lib/blame.tcl:1076 +msgid "Cannot find parent commit:" +msgstr "" + +#: lib/blame.tcl:1091 +msgid "Unable to display parent" +msgstr "" + +#: lib/blame.tcl:1092 lib/diff.tcl:297 +msgid "Error loading diff:" +msgstr "" + +#: lib/blame.tcl:1232 msgid "Originally By:" msgstr "" -#: lib/blame.tcl:1012 +#: lib/blame.tcl:1238 msgid "In File:" msgstr "" -#: lib/blame.tcl:1017 +#: lib/blame.tcl:1243 msgid "Copied Or Moved Here By:" msgstr "" @@ -546,16 +639,18 @@ msgstr "" #: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35 #: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282 -#: lib/checkout_op.tcl:544 lib/choose_font.tcl:43 lib/merge.tcl:171 -#: lib/option.tcl:103 lib/remote_branch_delete.tcl:42 lib/transport.tcl:97 +#: lib/checkout_op.tcl:544 lib/choose_font.tcl:43 lib/merge.tcl:172 +#: lib/option.tcl:125 lib/remote_add.tcl:32 lib/remote_branch_delete.tcl:42 +#: lib/tools_dlg.tcl:40 lib/tools_dlg.tcl:204 lib/tools_dlg.tcl:352 +#: lib/transport.tcl:97 msgid "Cancel" msgstr "" -#: lib/branch_checkout.tcl:32 lib/browser.tcl:287 +#: lib/branch_checkout.tcl:32 lib/browser.tcl:287 lib/tools_dlg.tcl:328 msgid "Revision" msgstr "" -#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:244 +#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:280 msgid "Options" msgstr "" @@ -575,7 +670,7 @@ msgstr "" msgid "Create New Branch" msgstr "" -#: lib/branch_create.tcl:31 lib/choose_repository.tcl:371 +#: lib/branch_create.tcl:31 lib/choose_repository.tcl:377 msgid "Create" msgstr "" @@ -583,7 +678,7 @@ msgstr "" msgid "Branch Name" msgstr "" -#: lib/branch_create.tcl:43 +#: lib/branch_create.tcl:43 lib/remote_add.tcl:39 lib/tools_dlg.tcl:50 msgid "Name:" msgstr "" @@ -723,9 +818,9 @@ msgstr "" msgid "Browse Branch Files" msgstr "" -#: lib/browser.tcl:278 lib/choose_repository.tcl:387 -#: lib/choose_repository.tcl:472 lib/choose_repository.tcl:482 -#: lib/choose_repository.tcl:985 +#: lib/browser.tcl:278 lib/choose_repository.tcl:394 +#: lib/choose_repository.tcl:480 lib/choose_repository.tcl:491 +#: lib/choose_repository.tcl:995 msgid "Browse" msgstr "" @@ -740,6 +835,7 @@ msgid "fatal: Cannot resolve %s" msgstr "" #: lib/checkout_op.tcl:145 lib/console.tcl:81 lib/database.tcl:31 +#: lib/sshkey.tcl:53 msgid "Close" msgstr "" @@ -836,7 +932,7 @@ msgstr "" msgid "Reset '%s'?" msgstr "" -#: lib/checkout_op.tcl:532 lib/merge.tcl:163 +#: lib/checkout_op.tcl:532 lib/merge.tcl:164 lib/tools_dlg.tcl:343 msgid "Visualize" msgstr "" @@ -877,221 +973,225 @@ msgstr "" msgid "Git Gui" msgstr "" -#: lib/choose_repository.tcl:81 lib/choose_repository.tcl:376 +#: lib/choose_repository.tcl:87 lib/choose_repository.tcl:382 msgid "Create New Repository" msgstr "" -#: lib/choose_repository.tcl:87 +#: lib/choose_repository.tcl:93 msgid "New..." msgstr "" -#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:458 +#: lib/choose_repository.tcl:100 lib/choose_repository.tcl:465 msgid "Clone Existing Repository" msgstr "" -#: lib/choose_repository.tcl:100 +#: lib/choose_repository.tcl:106 msgid "Clone..." msgstr "" -#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:974 +#: lib/choose_repository.tcl:113 lib/choose_repository.tcl:983 msgid "Open Existing Repository" msgstr "" -#: lib/choose_repository.tcl:113 +#: lib/choose_repository.tcl:119 msgid "Open..." msgstr "" -#: lib/choose_repository.tcl:126 +#: lib/choose_repository.tcl:132 msgid "Recent Repositories" msgstr "" -#: lib/choose_repository.tcl:132 +#: lib/choose_repository.tcl:138 msgid "Open Recent Repository:" msgstr "" -#: lib/choose_repository.tcl:296 lib/choose_repository.tcl:303 -#: lib/choose_repository.tcl:310 +#: lib/choose_repository.tcl:302 lib/choose_repository.tcl:309 +#: lib/choose_repository.tcl:316 #, tcl-format msgid "Failed to create repository %s:" msgstr "" -#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:476 +#: lib/choose_repository.tcl:387 msgid "Directory:" msgstr "" -#: lib/choose_repository.tcl:410 lib/choose_repository.tcl:535 -#: lib/choose_repository.tcl:1007 +#: lib/choose_repository.tcl:417 lib/choose_repository.tcl:544 +#: lib/choose_repository.tcl:1017 msgid "Git Repository" msgstr "" -#: lib/choose_repository.tcl:435 +#: lib/choose_repository.tcl:442 #, tcl-format msgid "Directory %s already exists." msgstr "" -#: lib/choose_repository.tcl:439 +#: lib/choose_repository.tcl:446 #, tcl-format msgid "File %s already exists." msgstr "" -#: lib/choose_repository.tcl:453 +#: lib/choose_repository.tcl:460 msgid "Clone" msgstr "" -#: lib/choose_repository.tcl:466 -msgid "URL:" +#: lib/choose_repository.tcl:473 +msgid "Source Location:" msgstr "" -#: lib/choose_repository.tcl:487 +#: lib/choose_repository.tcl:484 +msgid "Target Directory:" +msgstr "" + +#: lib/choose_repository.tcl:496 msgid "Clone Type:" msgstr "" -#: lib/choose_repository.tcl:493 +#: lib/choose_repository.tcl:502 msgid "Standard (Fast, Semi-Redundant, Hardlinks)" msgstr "" -#: lib/choose_repository.tcl:499 +#: lib/choose_repository.tcl:508 msgid "Full Copy (Slower, Redundant Backup)" msgstr "" -#: lib/choose_repository.tcl:505 +#: lib/choose_repository.tcl:514 msgid "Shared (Fastest, Not Recommended, No Backup)" msgstr "" -#: lib/choose_repository.tcl:541 lib/choose_repository.tcl:588 -#: lib/choose_repository.tcl:734 lib/choose_repository.tcl:804 -#: lib/choose_repository.tcl:1013 lib/choose_repository.tcl:1021 +#: lib/choose_repository.tcl:550 lib/choose_repository.tcl:597 +#: lib/choose_repository.tcl:743 lib/choose_repository.tcl:813 +#: lib/choose_repository.tcl:1023 lib/choose_repository.tcl:1031 #, tcl-format msgid "Not a Git repository: %s" msgstr "" -#: lib/choose_repository.tcl:577 +#: lib/choose_repository.tcl:586 msgid "Standard only available for local repository." msgstr "" -#: lib/choose_repository.tcl:581 +#: lib/choose_repository.tcl:590 msgid "Shared only available for local repository." msgstr "" -#: lib/choose_repository.tcl:602 +#: lib/choose_repository.tcl:611 #, tcl-format msgid "Location %s already exists." msgstr "" -#: lib/choose_repository.tcl:613 +#: lib/choose_repository.tcl:622 msgid "Failed to configure origin" msgstr "" -#: lib/choose_repository.tcl:625 +#: lib/choose_repository.tcl:634 msgid "Counting objects" msgstr "" -#: lib/choose_repository.tcl:626 +#: lib/choose_repository.tcl:635 msgid "buckets" msgstr "" -#: lib/choose_repository.tcl:650 +#: lib/choose_repository.tcl:659 #, tcl-format msgid "Unable to copy objects/info/alternates: %s" msgstr "" -#: lib/choose_repository.tcl:686 +#: lib/choose_repository.tcl:695 #, tcl-format msgid "Nothing to clone from %s." msgstr "" -#: lib/choose_repository.tcl:688 lib/choose_repository.tcl:902 -#: lib/choose_repository.tcl:914 +#: lib/choose_repository.tcl:697 lib/choose_repository.tcl:911 +#: lib/choose_repository.tcl:923 msgid "The 'master' branch has not been initialized." msgstr "" -#: lib/choose_repository.tcl:701 +#: lib/choose_repository.tcl:710 msgid "Hardlinks are unavailable. Falling back to copying." msgstr "" -#: lib/choose_repository.tcl:713 +#: lib/choose_repository.tcl:722 #, tcl-format msgid "Cloning from %s" msgstr "" -#: lib/choose_repository.tcl:744 +#: lib/choose_repository.tcl:753 msgid "Copying objects" msgstr "" -#: lib/choose_repository.tcl:745 +#: lib/choose_repository.tcl:754 msgid "KiB" msgstr "" -#: lib/choose_repository.tcl:769 +#: lib/choose_repository.tcl:778 #, tcl-format msgid "Unable to copy object: %s" msgstr "" -#: lib/choose_repository.tcl:779 +#: lib/choose_repository.tcl:788 msgid "Linking objects" msgstr "" -#: lib/choose_repository.tcl:780 +#: lib/choose_repository.tcl:789 msgid "objects" msgstr "" -#: lib/choose_repository.tcl:788 +#: lib/choose_repository.tcl:797 #, tcl-format msgid "Unable to hardlink object: %s" msgstr "" -#: lib/choose_repository.tcl:843 +#: lib/choose_repository.tcl:852 msgid "Cannot fetch branches and objects. See console output for details." msgstr "" -#: lib/choose_repository.tcl:854 +#: lib/choose_repository.tcl:863 msgid "Cannot fetch tags. See console output for details." msgstr "" -#: lib/choose_repository.tcl:878 +#: lib/choose_repository.tcl:887 msgid "Cannot determine HEAD. See console output for details." msgstr "" -#: lib/choose_repository.tcl:887 +#: lib/choose_repository.tcl:896 #, tcl-format msgid "Unable to cleanup %s" msgstr "" -#: lib/choose_repository.tcl:893 +#: lib/choose_repository.tcl:902 msgid "Clone failed." msgstr "" -#: lib/choose_repository.tcl:900 +#: lib/choose_repository.tcl:909 msgid "No default branch obtained." msgstr "" -#: lib/choose_repository.tcl:911 +#: lib/choose_repository.tcl:920 #, tcl-format msgid "Cannot resolve %s as a commit." msgstr "" -#: lib/choose_repository.tcl:923 +#: lib/choose_repository.tcl:932 msgid "Creating working directory" msgstr "" -#: lib/choose_repository.tcl:924 lib/index.tcl:65 lib/index.tcl:127 -#: lib/index.tcl:193 +#: lib/choose_repository.tcl:933 lib/index.tcl:65 lib/index.tcl:128 +#: lib/index.tcl:196 msgid "files" msgstr "" -#: lib/choose_repository.tcl:953 +#: lib/choose_repository.tcl:962 msgid "Initial file checkout failed." msgstr "" -#: lib/choose_repository.tcl:969 +#: lib/choose_repository.tcl:978 msgid "Open" msgstr "" -#: lib/choose_repository.tcl:979 +#: lib/choose_repository.tcl:988 msgid "Repository:" msgstr "" -#: lib/choose_repository.tcl:1027 +#: lib/choose_repository.tcl:1037 #, tcl-format msgid "Failed to open repository %s:" msgstr "" @@ -1176,7 +1276,7 @@ msgid "" "The rescan will be automatically started now.\n" msgstr "" -#: lib/commit.tcl:154 +#: lib/commit.tcl:156 #, tcl-format msgid "" "Unmerged files cannot be committed.\n" @@ -1185,7 +1285,7 @@ msgid "" "before committing.\n" msgstr "" -#: lib/commit.tcl:162 +#: lib/commit.tcl:164 #, tcl-format msgid "" "Unknown file state %s detected.\n" @@ -1193,14 +1293,14 @@ msgid "" "File %s cannot be committed by this program.\n" msgstr "" -#: lib/commit.tcl:170 +#: lib/commit.tcl:172 msgid "" "No changes to commit.\n" "\n" "You must stage at least 1 file before you can commit.\n" msgstr "" -#: lib/commit.tcl:183 +#: lib/commit.tcl:187 msgid "" "Please supply a commit message.\n" "\n" @@ -1211,45 +1311,45 @@ msgid "" "- Remaining lines: Describe why this change is good.\n" msgstr "" -#: lib/commit.tcl:207 +#: lib/commit.tcl:211 #, tcl-format msgid "warning: Tcl does not support encoding '%s'." msgstr "" -#: lib/commit.tcl:221 +#: lib/commit.tcl:227 msgid "Calling pre-commit hook..." msgstr "" -#: lib/commit.tcl:236 +#: lib/commit.tcl:242 msgid "Commit declined by pre-commit hook." msgstr "" -#: lib/commit.tcl:259 +#: lib/commit.tcl:265 msgid "Calling commit-msg hook..." msgstr "" -#: lib/commit.tcl:274 +#: lib/commit.tcl:280 msgid "Commit declined by commit-msg hook." msgstr "" -#: lib/commit.tcl:287 +#: lib/commit.tcl:293 msgid "Committing changes..." msgstr "" -#: lib/commit.tcl:303 +#: lib/commit.tcl:309 msgid "write-tree failed:" msgstr "" -#: lib/commit.tcl:304 lib/commit.tcl:348 lib/commit.tcl:368 +#: lib/commit.tcl:310 lib/commit.tcl:354 lib/commit.tcl:374 msgid "Commit failed." msgstr "" -#: lib/commit.tcl:321 +#: lib/commit.tcl:327 #, tcl-format msgid "Commit %s appears to be corrupt" msgstr "" -#: lib/commit.tcl:326 +#: lib/commit.tcl:332 msgid "" "No changes to commit.\n" "\n" @@ -1258,19 +1358,19 @@ msgid "" "A rescan will be automatically started now.\n" msgstr "" -#: lib/commit.tcl:333 +#: lib/commit.tcl:339 msgid "No changes to commit." msgstr "" -#: lib/commit.tcl:347 +#: lib/commit.tcl:353 msgid "commit-tree failed:" msgstr "" -#: lib/commit.tcl:367 +#: lib/commit.tcl:373 msgid "update-ref failed:" msgstr "" -#: lib/commit.tcl:454 +#: lib/commit.tcl:461 #, tcl-format msgid "Created commit %s: %s" msgstr "" @@ -1339,7 +1439,7 @@ msgstr "" msgid "Invalid date from Git: %s" msgstr "" -#: lib/diff.tcl:44 +#: lib/diff.tcl:59 #, tcl-format msgid "" "No differences detected.\n" @@ -1353,48 +1453,92 @@ msgid "" "the same state." msgstr "" -#: lib/diff.tcl:83 +#: lib/diff.tcl:99 #, tcl-format msgid "Loading diff of %s..." msgstr "" -#: lib/diff.tcl:116 lib/diff.tcl:190 +#: lib/diff.tcl:120 +msgid "" +"LOCAL: deleted\n" +"REMOTE:\n" +msgstr "" + +#: lib/diff.tcl:125 +msgid "" +"REMOTE: deleted\n" +"LOCAL:\n" +msgstr "" + +#: lib/diff.tcl:132 +msgid "LOCAL:\n" +msgstr "" + +#: lib/diff.tcl:135 +msgid "REMOTE:\n" +msgstr "" + +#: lib/diff.tcl:197 lib/diff.tcl:296 #, tcl-format msgid "Unable to display %s" msgstr "" -#: lib/diff.tcl:117 +#: lib/diff.tcl:198 msgid "Error loading file:" msgstr "" -#: lib/diff.tcl:124 +#: lib/diff.tcl:205 msgid "Git Repository (subproject)" msgstr "" -#: lib/diff.tcl:136 +#: lib/diff.tcl:217 msgid "* Binary file (not showing content)." msgstr "" -#: lib/diff.tcl:191 -msgid "Error loading diff:" +#: lib/diff.tcl:222 +#, tcl-format +msgid "" +"* Untracked file is %d bytes.\n" +"* Showing only first %d bytes.\n" +msgstr "" + +#: lib/diff.tcl:228 +#, tcl-format +msgid "" +"\n" +"* Untracked file clipped here by %s.\n" +"* To see the entire file, use an external editor.\n" msgstr "" -#: lib/diff.tcl:313 +#: lib/diff.tcl:436 msgid "Failed to unstage selected hunk." msgstr "" -#: lib/diff.tcl:320 +#: lib/diff.tcl:443 msgid "Failed to stage selected hunk." msgstr "" -#: lib/diff.tcl:386 +#: lib/diff.tcl:509 msgid "Failed to unstage selected line." msgstr "" -#: lib/diff.tcl:394 +#: lib/diff.tcl:517 msgid "Failed to stage selected line." msgstr "" +#: lib/encoding.tcl:443 +msgid "Default" +msgstr "" + +#: lib/encoding.tcl:448 +#, tcl-format +msgid "System (%s)" +msgstr "" + +#: lib/encoding.tcl:459 lib/encoding.tcl:465 +msgid "Other" +msgstr "" + #: lib/error.tcl:20 lib/error.tcl:114 msgid "error" msgstr "" @@ -1429,38 +1573,47 @@ msgstr "" msgid "Unlock Index" msgstr "" -#: lib/index.tcl:282 +#: lib/index.tcl:287 #, tcl-format msgid "Unstaging %s from commit" msgstr "" -#: lib/index.tcl:313 +#: lib/index.tcl:326 msgid "Ready to commit." msgstr "" -#: lib/index.tcl:326 +#: lib/index.tcl:339 #, tcl-format msgid "Adding %s" msgstr "" -#: lib/index.tcl:381 +#: lib/index.tcl:396 #, tcl-format msgid "Revert changes in file %s?" msgstr "" -#: lib/index.tcl:383 +#: lib/index.tcl:398 #, tcl-format msgid "Revert changes in these %i files?" msgstr "" -#: lib/index.tcl:391 +#: lib/index.tcl:406 msgid "Any unstaged changes will be permanently lost by the revert." msgstr "" -#: lib/index.tcl:394 +#: lib/index.tcl:409 msgid "Do Nothing" msgstr "" +#: lib/index.tcl:427 +msgid "Reverting selected files" +msgstr "" + +#: lib/index.tcl:431 +#, tcl-format +msgid "Reverting %s" +msgstr "" + #: lib/merge.tcl:13 msgid "" "Cannot merge while amending.\n" @@ -1478,7 +1631,7 @@ msgid "" "The rescan will be automatically started now.\n" msgstr "" -#: lib/merge.tcl:44 +#: lib/merge.tcl:45 #, tcl-format msgid "" "You are in the middle of a conflicted merge.\n" @@ -1489,7 +1642,7 @@ msgid "" "merge. Only then can you begin another merge.\n" msgstr "" -#: lib/merge.tcl:54 +#: lib/merge.tcl:55 #, tcl-format msgid "" "You are in the middle of a change.\n" @@ -1500,41 +1653,41 @@ msgid "" "will help you abort a failed merge, should the need arise.\n" msgstr "" -#: lib/merge.tcl:106 +#: lib/merge.tcl:107 #, tcl-format msgid "%s of %s" msgstr "" -#: lib/merge.tcl:119 +#: lib/merge.tcl:120 #, tcl-format msgid "Merging %s and %s..." msgstr "" -#: lib/merge.tcl:130 +#: lib/merge.tcl:131 msgid "Merge completed successfully." msgstr "" -#: lib/merge.tcl:132 +#: lib/merge.tcl:133 msgid "Merge failed. Conflict resolution is required." msgstr "" -#: lib/merge.tcl:157 +#: lib/merge.tcl:158 #, tcl-format msgid "Merge Into %s" msgstr "" -#: lib/merge.tcl:176 +#: lib/merge.tcl:177 msgid "Revision To Merge" msgstr "" -#: lib/merge.tcl:211 +#: lib/merge.tcl:212 msgid "" "Cannot abort while amending.\n" "\n" "You must finish amending this commit.\n" msgstr "" -#: lib/merge.tcl:221 +#: lib/merge.tcl:222 msgid "" "Abort merge?\n" "\n" @@ -1543,7 +1696,7 @@ msgid "" "Continue with aborting the current merge?" msgstr "" -#: lib/merge.tcl:227 +#: lib/merge.tcl:228 msgid "" "Reset changes?\n" "\n" @@ -1552,130 +1705,312 @@ msgid "" "Continue with resetting the current changes?" msgstr "" -#: lib/merge.tcl:238 +#: lib/merge.tcl:239 msgid "Aborting" msgstr "" -#: lib/merge.tcl:238 +#: lib/merge.tcl:239 msgid "files reset" msgstr "" -#: lib/merge.tcl:266 +#: lib/merge.tcl:267 msgid "Abort failed." msgstr "" -#: lib/merge.tcl:268 +#: lib/merge.tcl:269 msgid "Abort completed. Ready." msgstr "" -#: lib/option.tcl:95 +#: lib/mergetool.tcl:8 +msgid "Force resolution to the base version?" +msgstr "" + +#: lib/mergetool.tcl:9 +msgid "Force resolution to this branch?" +msgstr "" + +#: lib/mergetool.tcl:10 +msgid "Force resolution to the other branch?" +msgstr "" + +#: lib/mergetool.tcl:14 +#, tcl-format +msgid "" +"Note that the diff shows only conflicting changes.\n" +"\n" +"%s will be overwritten.\n" +"\n" +"This operation can be undone only by restarting the merge." +msgstr "" + +#: lib/mergetool.tcl:45 +#, tcl-format +msgid "File %s seems to have unresolved conflicts, still stage?" +msgstr "" + +#: lib/mergetool.tcl:60 +#, tcl-format +msgid "Adding resolution for %s" +msgstr "" + +#: lib/mergetool.tcl:141 +msgid "Cannot resolve deletion or link conflicts using a tool" +msgstr "" + +#: lib/mergetool.tcl:146 +msgid "Conflict file does not exist" +msgstr "" + +#: lib/mergetool.tcl:264 +#, tcl-format +msgid "Not a GUI merge tool: '%s'" +msgstr "" + +#: lib/mergetool.tcl:268 +#, tcl-format +msgid "Unsupported merge tool '%s'" +msgstr "" + +#: lib/mergetool.tcl:303 +msgid "Merge tool is already running, terminate it?" +msgstr "" + +#: lib/mergetool.tcl:323 +#, tcl-format +msgid "" +"Error retrieving versions:\n" +"%s" +msgstr "" + +#: lib/mergetool.tcl:343 +#, tcl-format +msgid "" +"Could not start the merge tool:\n" +"\n" +"%s" +msgstr "" + +#: lib/mergetool.tcl:347 +msgid "Running merge tool..." +msgstr "" + +#: lib/mergetool.tcl:375 lib/mergetool.tcl:383 +msgid "Merge tool failed." +msgstr "" + +#: lib/option.tcl:11 +#, tcl-format +msgid "Invalid global encoding '%s'" +msgstr "" + +#: lib/option.tcl:19 +#, tcl-format +msgid "Invalid repo encoding '%s'" +msgstr "" + +#: lib/option.tcl:117 msgid "Restore Defaults" msgstr "" -#: lib/option.tcl:99 +#: lib/option.tcl:121 msgid "Save" msgstr "" -#: lib/option.tcl:109 +#: lib/option.tcl:131 #, tcl-format msgid "%s Repository" msgstr "" -#: lib/option.tcl:110 +#: lib/option.tcl:132 msgid "Global (All Repositories)" msgstr "" -#: lib/option.tcl:116 +#: lib/option.tcl:138 msgid "User Name" msgstr "" -#: lib/option.tcl:117 +#: lib/option.tcl:139 msgid "Email Address" msgstr "" -#: lib/option.tcl:119 +#: lib/option.tcl:141 msgid "Summarize Merge Commits" msgstr "" -#: lib/option.tcl:120 +#: lib/option.tcl:142 msgid "Merge Verbosity" msgstr "" -#: lib/option.tcl:121 +#: lib/option.tcl:143 msgid "Show Diffstat After Merge" msgstr "" -#: lib/option.tcl:123 +#: lib/option.tcl:144 +msgid "Use Merge Tool" +msgstr "" + +#: lib/option.tcl:146 msgid "Trust File Modification Timestamps" msgstr "" -#: lib/option.tcl:124 +#: lib/option.tcl:147 msgid "Prune Tracking Branches During Fetch" msgstr "" -#: lib/option.tcl:125 +#: lib/option.tcl:148 msgid "Match Tracking Branches" msgstr "" -#: lib/option.tcl:126 +#: lib/option.tcl:149 msgid "Blame Copy Only On Changed Files" msgstr "" -#: lib/option.tcl:127 +#: lib/option.tcl:150 msgid "Minimum Letters To Blame Copy On" msgstr "" -#: lib/option.tcl:128 +#: lib/option.tcl:151 +msgid "Blame History Context Radius (days)" +msgstr "" + +#: lib/option.tcl:152 msgid "Number of Diff Context Lines" msgstr "" -#: lib/option.tcl:129 +#: lib/option.tcl:153 msgid "Commit Message Text Width" msgstr "" -#: lib/option.tcl:130 +#: lib/option.tcl:154 msgid "New Branch Name Template" msgstr "" -#: lib/option.tcl:194 +#: lib/option.tcl:155 +msgid "Default File Contents Encoding" +msgstr "" + +#: lib/option.tcl:203 +msgid "Change" +msgstr "" + +#: lib/option.tcl:230 msgid "Spelling Dictionary:" msgstr "" -#: lib/option.tcl:218 +#: lib/option.tcl:254 msgid "Change Font" msgstr "" -#: lib/option.tcl:222 +#: lib/option.tcl:258 #, tcl-format msgid "Choose %s" msgstr "" -#: lib/option.tcl:228 +#: lib/option.tcl:264 msgid "pt." msgstr "" -#: lib/option.tcl:242 +#: lib/option.tcl:278 msgid "Preferences" msgstr "" -#: lib/option.tcl:277 +#: lib/option.tcl:314 msgid "Failed to completely save options:" msgstr "" -#: lib/remote.tcl:165 +#: lib/remote.tcl:163 +msgid "Remove Remote" +msgstr "" + +#: lib/remote.tcl:168 msgid "Prune from" msgstr "" -#: lib/remote.tcl:170 +#: lib/remote.tcl:173 msgid "Fetch from" msgstr "" -#: lib/remote.tcl:213 +#: lib/remote.tcl:215 msgid "Push to" msgstr "" +#: lib/remote_add.tcl:19 +msgid "Add Remote" +msgstr "" + +#: lib/remote_add.tcl:24 +msgid "Add New Remote" +msgstr "" + +#: lib/remote_add.tcl:28 lib/tools_dlg.tcl:36 +msgid "Add" +msgstr "" + +#: lib/remote_add.tcl:37 +msgid "Remote Details" +msgstr "" + +#: lib/remote_add.tcl:50 +msgid "Location:" +msgstr "" + +#: lib/remote_add.tcl:62 +msgid "Further Action" +msgstr "" + +#: lib/remote_add.tcl:65 +msgid "Fetch Immediately" +msgstr "" + +#: lib/remote_add.tcl:71 +msgid "Initialize Remote Repository and Push" +msgstr "" + +#: lib/remote_add.tcl:77 +msgid "Do Nothing Else Now" +msgstr "" + +#: lib/remote_add.tcl:101 +msgid "Please supply a remote name." +msgstr "" + +#: lib/remote_add.tcl:114 +#, tcl-format +msgid "'%s' is not an acceptable remote name." +msgstr "" + +#: lib/remote_add.tcl:125 +#, tcl-format +msgid "Failed to add remote '%s' of location '%s'." +msgstr "" + +#: lib/remote_add.tcl:133 lib/transport.tcl:6 +#, tcl-format +msgid "fetch %s" +msgstr "" + +#: lib/remote_add.tcl:134 +#, tcl-format +msgid "Fetching the %s" +msgstr "" + +#: lib/remote_add.tcl:157 +#, tcl-format +msgid "Do not know how to initialize repository at location '%s'." +msgstr "" + +#: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:71 +#, tcl-format +msgid "push %s" +msgstr "" + +#: lib/remote_add.tcl:164 +#, tcl-format +msgid "Setting up the %s (at %s)" +msgstr "" + #: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34 -msgid "Delete Remote Branch" +msgid "Delete Branch Remotely" msgstr "" #: lib/remote_branch_delete.tcl:47 @@ -1687,7 +2022,7 @@ msgid "Remote:" msgstr "" #: lib/remote_branch_delete.tcl:66 lib/transport.tcl:138 -msgid "Arbitrary URL:" +msgid "Arbitrary Location:" msgstr "" #: lib/remote_branch_delete.tcl:84 @@ -1750,6 +2085,22 @@ msgstr "" msgid "Scanning %s..." msgstr "" +#: lib/search.tcl:21 +msgid "Find:" +msgstr "" + +#: lib/search.tcl:23 +msgid "Next" +msgstr "" + +#: lib/search.tcl:24 +msgid "Prev" +msgstr "" + +#: lib/search.tcl:25 +msgid "Case-Sensitive" +msgstr "" + #: lib/shortcut.tcl:20 lib/shortcut.tcl:61 msgid "Cannot write shortcut:" msgstr "" @@ -1787,22 +2138,182 @@ msgstr "" msgid "No Suggestions" msgstr "" -#: lib/spellcheck.tcl:387 +#: lib/spellcheck.tcl:388 msgid "Unexpected EOF from spell checker" msgstr "" -#: lib/spellcheck.tcl:391 +#: lib/spellcheck.tcl:392 msgid "Spell Checker Failed" msgstr "" +#: lib/sshkey.tcl:31 +msgid "No keys found." +msgstr "" + +#: lib/sshkey.tcl:34 +#, tcl-format +msgid "Found a public key in: %s" +msgstr "" + +#: lib/sshkey.tcl:40 +msgid "Generate Key" +msgstr "" + +#: lib/sshkey.tcl:56 +msgid "Copy To Clipboard" +msgstr "" + +#: lib/sshkey.tcl:70 +msgid "Your OpenSSH Public Key" +msgstr "" + +#: lib/sshkey.tcl:78 +msgid "Generating..." +msgstr "" + +#: lib/sshkey.tcl:84 +#, tcl-format +msgid "" +"Could not start ssh-keygen:\n" +"\n" +"%s" +msgstr "" + +#: lib/sshkey.tcl:111 +msgid "Generation failed." +msgstr "" + +#: lib/sshkey.tcl:118 +msgid "Generation succeded, but no keys found." +msgstr "" + +#: lib/sshkey.tcl:121 +#, tcl-format +msgid "Your key is in: %s" +msgstr "" + #: lib/status_bar.tcl:83 #, tcl-format msgid "%s ... %*i of %*i %s (%3i%%)" msgstr "" -#: lib/transport.tcl:6 +#: lib/tools.tcl:75 #, tcl-format -msgid "fetch %s" +msgid "Running %s requires a selected file." +msgstr "" + +#: lib/tools.tcl:90 +#, tcl-format +msgid "Are you sure you want to run %s?" +msgstr "" + +#: lib/tools.tcl:110 +#, tcl-format +msgid "Tool: %s" +msgstr "" + +#: lib/tools.tcl:111 +#, tcl-format +msgid "Running: %s" +msgstr "" + +#: lib/tools.tcl:149 +#, tcl-format +msgid "Tool completed succesfully: %s" +msgstr "" + +#: lib/tools.tcl:151 +#, tcl-format +msgid "Tool failed: %s" +msgstr "" + +#: lib/tools_dlg.tcl:22 +msgid "Add Tool" +msgstr "" + +#: lib/tools_dlg.tcl:28 +msgid "Add New Tool Command" +msgstr "" + +#: lib/tools_dlg.tcl:33 +msgid "Add globally" +msgstr "" + +#: lib/tools_dlg.tcl:45 +msgid "Tool Details" +msgstr "" + +#: lib/tools_dlg.tcl:48 +msgid "Use '/' separators to create a submenu tree:" +msgstr "" + +#: lib/tools_dlg.tcl:61 +msgid "Command:" +msgstr "" + +#: lib/tools_dlg.tcl:74 +msgid "Show a dialog before running" +msgstr "" + +#: lib/tools_dlg.tcl:80 +msgid "Ask the user to select a revision (sets $REVISION)" +msgstr "" + +#: lib/tools_dlg.tcl:85 +msgid "Ask the user for additional arguments (sets $ARGS)" +msgstr "" + +#: lib/tools_dlg.tcl:92 +msgid "Don't show the command output window" +msgstr "" + +#: lib/tools_dlg.tcl:97 +msgid "Run only if a diff is selected ($FILENAME not empty)" +msgstr "" + +#: lib/tools_dlg.tcl:121 +msgid "Please supply a name for the tool." +msgstr "" + +#: lib/tools_dlg.tcl:129 +#, tcl-format +msgid "Tool '%s' already exists." +msgstr "" + +#: lib/tools_dlg.tcl:151 +#, tcl-format +msgid "" +"Could not add tool:\n" +"%s" +msgstr "" + +#: lib/tools_dlg.tcl:190 +msgid "Remove Tool" +msgstr "" + +#: lib/tools_dlg.tcl:196 +msgid "Remove Tool Commands" +msgstr "" + +#: lib/tools_dlg.tcl:200 +msgid "Remove" +msgstr "" + +#: lib/tools_dlg.tcl:236 +msgid "(Blue denotes repository-local tools)" +msgstr "" + +#: lib/tools_dlg.tcl:297 +#, tcl-format +msgid "Run Command: %s" +msgstr "" + +#: lib/tools_dlg.tcl:311 +msgid "Arguments" +msgstr "" + +#: lib/tools_dlg.tcl:348 +msgid "OK" msgstr "" #: lib/transport.tcl:7 @@ -1820,11 +2331,6 @@ msgstr "" msgid "Pruning tracking branches deleted from %s" msgstr "" -#: lib/transport.tcl:25 lib/transport.tcl:71 -#, tcl-format -msgid "push %s" -msgstr "" - #: lib/transport.tcl:26 #, tcl-format msgid "Pushing changes to %s" |