From dd87558f58d989e47de09eafefa8d2f2ea4de27d Mon Sep 17 00:00:00 2001 From: Gustaf Hendeby Date: Thu, 25 Sep 2008 23:31:22 +0200 Subject: git-gui: Help identify aspell version on Windows too On windows, git gui fails to correctly extract the aspell version (experienced with aspell version 0.50.3) due to scilent white space at the end of the version string. Trim the obtained version string to work around this. Signed-off-by: Gustaf Hendeby Signed-off-by: Shawn O. Pearce diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl index 78f344f..a479b2f 100644 --- a/lib/spellcheck.tcl +++ b/lib/spellcheck.tcl @@ -80,7 +80,7 @@ method _connect {pipe_fd} { error_popup [strcat [mc "Unrecognized spell checker"] ":\n\n$s_version"] return } - set s_version [string range $s_version 5 end] + set s_version [string range [string trim $s_version] 5 end] regexp \ {International Ispell Version .* \(but really (Aspell .*?)\)$} \ $s_version _junk s_version -- cgit v0.10.2-6-g49f6 From ed70e4d7db69a66d833d1efe56606213bab807e1 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 26 Sep 2008 07:44:40 -0700 Subject: git-gui: Show/hide "Sign Off" based on nocommitmsg option If citool --nocommit is invoked we hide the Sign Off features, as the commit message area is not editable. But we really want the selection tied to the message area's editing ability. Suggested-by: Alexander Gavrilov Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 4085e8f..09ce410 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2413,7 +2413,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} { .mbar.commit add separator - if {![is_enabled nocommit]} { + if {![is_enabled nocommitmsg]} { .mbar.commit add command -label [mc "Sign Off"] \ -command do_signoff \ -accelerator $M1T-S @@ -2743,7 +2743,7 @@ pack .vpane.lower.commarea.buttons.incall -side top -fill x lappend disable_on_lock \ {.vpane.lower.commarea.buttons.incall conf -state} -if {![is_enabled nocommit]} { +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 -- cgit v0.10.2-6-g49f6 From d3bcf55d675a255c00d2743c00978e1f42c93572 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 24 Sep 2008 21:08:01 +0200 Subject: git-gui: Do not automatically stage file after merge tool finishes If a merge tool was invoked on a conflicted file and the tool completed, then the conflicted file was staged automatically. However, the fact that the user closed the merge tool cannot be understood as the unequivocal sign that the conflict was completely resolved. For example, the user could have decided to postpone the resolution of the conflict, or could have accidentally closed the tool. We better leave the file unstaged and let the user stage it explicitly. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/mergetool.tcl b/lib/mergetool.tcl index 6ab5701..8d1ee5b 100644 --- a/lib/mergetool.tcl +++ b/lib/mergetool.tcl @@ -375,14 +375,6 @@ proc merge_tool_finish {fd} { } } - # Check the modification time of the target file - if {!$failed && [file mtime $mtool_target] eq $mtool_mtime} { - if {[ask_popup [mc "File %s unchanged, still accept as resolved?" \ - [short_path $mtool_target]]] ne {yes}} { - set failed 1 - } - } - # Finish if {$failed} { file rename -force -- $backup $mtool_target @@ -395,6 +387,6 @@ proc merge_tool_finish {fd} { delete_temp_files $mtool_tmpfiles - merge_add_resolution $mtool_target + reshow_diff } } -- cgit v0.10.2-6-g49f6 From 0aea2842d9d556afa4a3e8120e465479ad7368ca Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Tue, 30 Sep 2008 12:12:16 +0400 Subject: git-gui: Make Ctrl-T safe to use for conflicting files. A previous patch added a check for conflict markers, which is done when the file is about to be staged due to a click on the icon. However, pressing Ctrl-T still immediately stages the file without confirmation. This patch fixes it. The check requires a loaded diff, so staging multiple files at once won't work if they are unmerged. Signed-off-by: Alexander Gavrilov Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 09ce410..4d52f02 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2090,7 +2090,9 @@ proc toggle_or_diff {w x y} { if {$col == 0 && $y > 1} { # Conflicts need special handling if {[string first {U} $state] >= 0} { - merge_stage_workdir $path $w $lno + # $w must always be $ui_workdir, but... + if {$w ne $ui_workdir} { set lno {} } + merge_stage_workdir $path $lno return } diff --git a/lib/index.tcl b/lib/index.tcl index b045219..d33896a 100644 --- a/lib/index.tcl +++ b/lib/index.tcl @@ -298,11 +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 - - ?T - - U? { + ?T { lappend pathList $path if {$path eq $current_diff_path} { set after {reshow_diff;} diff --git a/lib/merge.tcl b/lib/merge.tcl index 5c01875..ac4c7de 100644 --- a/lib/merge.tcl +++ b/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/lib/mergetool.tcl b/lib/mergetool.tcl index 8d1ee5b..eb2b4b5 100644 --- a/lib/mergetool.tcl +++ b/lib/mergetool.tcl @@ -23,13 +23,14 @@ This operation can be undone only by restarting the merge." \ } } -proc merge_stage_workdir {path w lno} { +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} { - show_diff $path $w $lno {} [list do_merge_stage_workdir $path] + 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 } -- cgit v0.10.2-6-g49f6 From 34785f8ccabb12f684352902b7f201135b9ccd51 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 30 Sep 2008 08:39:29 +0200 Subject: git-gui: Remove space from the end of aspell's reply before processing When git gui processes a reply from aspell it explicitly ignores an empty line. The Windows version of aspell, however, terminates lines with CRLF, but TCL's 'gets' does not remove CR, hence, a "visibly" empty line was not actually recognized as empty. With this change we explicitly trim off whitespace before the line is further processed. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl index a479b2f..e612030 100644 --- a/lib/spellcheck.tcl +++ b/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" -- cgit v0.10.2-6-g49f6 From 3c1c2a00b2cba9dfeee6e2a3c44a0ad52fcff4a8 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 22:43:59 +0200 Subject: git-gui: Clarify the Remote -> Delete... action Currently, it was not really clear what all does this perform. We rename "Delete..." to "Delete Branch..." (since this does not delete the remote as a whole) and relabel the window from "Delete Remote Branch" to "Delete Branch Remotely" (since the action also involves pushing the delete out). Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 4d52f02..078636f 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2453,7 +2453,7 @@ if {[is_enabled transport]} { -command do_push_anywhere \ -accelerator $M1T-P .mbar.remote add command \ - -label [mc "Delete..."] \ + -label [mc "Delete Branch..."] \ -command remote_branch_delete::dialog } diff --git a/lib/remote_branch_delete.tcl b/lib/remote_branch_delete.tcl index c7b8148..fbcfb27 100644 --- a/lib/remote_branch_delete.tcl +++ b/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 -- cgit v0.10.2-6-g49f6 From 8329bd07250e0b26b76105d299b6153a68c3c404 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 22:44:00 +0200 Subject: git-gui: Squash populate_{push,fetch}_menu to populate_remotes_menu The meat of the routines is now separated to add_fetch_entry() and add_push_entry(). This refactoring will allow easy implementation of adding individual remotes later. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 078636f..ecc3b63 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3263,8 +3263,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 } diff --git a/lib/remote.tcl b/lib/remote.tcl index 0e86dda..d97c851 100644 --- a/lib/remote.tcl +++ b/lib/remote.tcl @@ -132,91 +132,92 @@ 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 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 - } - - $fetch_m add command \ - -label $r \ - -command [list fetch_from $r] - $prune_m add command \ - -label $r \ - -command [list prune_from $r] + 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 } + + $fetch_m add command \ + -label $r \ + -command [list fetch_from $r] + $prune_m add command \ + -label $r \ + -command [list prune_from $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 } } -- cgit v0.10.2-6-g49f6 From ba6485e05d43abf66e6b651a41b1ddc511b0e5eb Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 22:44:01 +0200 Subject: git-gui: Add support for adding remotes When a remote is being added, it can also be automatically either fetched or initialized and pushed; this patch adds capability for initializing of local and ssh repositories. This also of course leaves a lot of space for further customization features, like individually turning the initialization phase on/off or tuning attributes of the remote repository; I consider that out of scope of this patch, however. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index ecc3b63..ae9832c 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2449,6 +2449,10 @@ 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 diff --git a/lib/remote.tcl b/lib/remote.tcl index d97c851..643f0bc 100644 --- a/lib/remote.tcl +++ b/lib/remote.tcl @@ -221,3 +221,18 @@ proc populate_remotes_menu {} { 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 +} diff --git a/lib/remote_add.tcl b/lib/remote_add.tcl new file mode 100644 index 0000000..89e88ee --- /dev/null +++ b/lib/remote_add.tcl @@ -0,0 +1,190 @@ +# 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 [cb _visible] + bind $w [list destroy $w] + bind $w [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" $remote] \ + [mc "Fetching the %s" $remote]] + console::exec $c [list git fetch --all $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 git --git-dir=$path init --bare] + } elseif { ! [regexp {://} $location xx] } { + 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 +} + +} -- cgit v0.10.2-6-g49f6 From 0d4044123cb081bd690dece6505ffbcb8476e7ef Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 22:44:02 +0200 Subject: git-gui: Add support for removing remotes We introduce new submenu Remote -> Remove Remote, allowing to remove remotes. In the future, we might consider a confirmation popup to avoid misclicks, but removing a remote is not very lossy operation. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/lib/remote.tcl b/lib/remote.tcl index 643f0bc..1852247 100644 --- a/lib/remote.tcl +++ b/lib/remote.tcl @@ -137,6 +137,7 @@ proc add_fetch_entry {r} { set remote_m .mbar.remote set fetch_m $remote_m.fetch set prune_m $remote_m.prune + 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)}]} { @@ -157,6 +158,11 @@ proc add_fetch_entry {r} { 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"] \ @@ -174,6 +180,9 @@ proc add_fetch_entry {r} { $prune_m add command \ -label $r \ -command [list prune_from $r] + $remove_m add command \ + -label $r \ + -command [list remove_remote $r] } } @@ -236,3 +245,31 @@ proc add_single_remote {name location} { 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 + delete_from_menu $remote_m.push $name +} -- cgit v0.10.2-6-g49f6 From adcbd431e7ae3c6356c50fa2559ac06ddb970008 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 22:44:03 +0200 Subject: git-gui: mkdir -p when initializing new remote repository This allows the user to create repositories with arbitrary paths on the server. The downside is that errorneously typed paths are not caught but instead created remotely; YMMV. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/lib/remote_add.tcl b/lib/remote_add.tcl index 89e88ee..8e3ad16 100644 --- a/lib/remote_add.tcl +++ b/lib/remote_add.tcl @@ -144,8 +144,9 @@ method _add {} { if {[info exists env(GIT_SSH)]} { set ssh $env(GIT_SSH) } - lappend cmds [list exec $ssh $host git --git-dir=$path init --bare] + 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 \ -- cgit v0.10.2-6-g49f6 From 2db21e709a1345d84178e53079e861232c243bd1 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 23:57:16 +0200 Subject: git-gui: Use git web--browser for web browsing This patch removes git-gui specific webbrowser guessing and instead relies on git web--browser to do the right thing, removing unnecessary code duplication. New function start_browser encapsulates the browser execution, for usage from other parts of code. This will also make git-gui show the documentation menu item even in cases it might not be able to start up a browser, these cases should be however only very rare. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index ae9832c..fffb1e9 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2493,8 +2493,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] @@ -2502,34 +2501,19 @@ 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] +unset doc_path doc_url # -- Standard bindings # -- cgit v0.10.2-6-g49f6 From afd5424085151990b5ac87da09e5cea76809d7c0 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 00:05:53 +0200 Subject: git-gui: Add Explore Working Copy to the Repository menu Especially when cloning is finished, the Git GUI window pops up, but there is not really much one can do within it - there needs to be a way to easily start exploring and working with the new working copy using the standard system interface: explorer.exe on Windows, open on MacOS/X and xdg-open as a fallback (all modern Linux desktops). This might be also a post-clone option instead (possibly opening the window automagically) but I believe that this might be useful also in other situations, e.g. you don't have to keep the working copy window around if you work in multiple repositories. This operation will not make sense on bare repositories. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index fffb1e9..c4c66c0 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1869,6 +1869,19 @@ 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 @@ -2221,6 +2234,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] -- cgit v0.10.2-6-g49f6 From bb4812bc0ae6e14b422ce3c45504965b523fdf84 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 00:07:02 +0200 Subject: git-gui: gui.autoexplore makes explorer to pop up automatically after picking Especially for Windows users used to work with the Windows Explorer, it is very useful when after picking a repository (either opening a local one or initializing/cloning a new one) in the "intro" window, the explorer view of the working copy pops up along the standard Git GUI window, so that the users can, well, actually work with the repository. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index c4c66c0..79a108d 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -995,6 +995,7 @@ citool { ## ## repository setup +set picked 0 if {[catch { set _gitdir $env(GIT_DIR) set _prefix {} @@ -1006,6 +1007,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]} @@ -3376,3 +3378,6 @@ if {[is_enabled multicommit]} { if {[is_enabled retcode]} { bind . {+terminate_me %W} } +if {$picked && [is_config_true gui.autoexplore]} { + do_explore +} -- cgit v0.10.2-6-g49f6 From 4259568d722d0a46993ad945ffdba0f084448b37 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 00:12:50 +0200 Subject: git-gui: Avoid using the term URL when specifying repositories Instead, 'Location' is used to label such inputs; in the Clone dialog, 'Source' and 'Target' are also introduced to further clarify the situation. The intent is to increase GUI consistency in the case location templates (upcoming) are used - then, other locators than URL may be used. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl index 3180786..f54d88a 100644 --- a/lib/choose_repository.tcl +++ b/lib/choose_repository.tcl @@ -463,7 +463,7 @@ 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 \ @@ -473,7 +473,7 @@ method _do_clone {} { -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 \ diff --git a/lib/remote_branch_delete.tcl b/lib/remote_branch_delete.tcl index fbcfb27..89eb0f7 100644 --- a/lib/remote_branch_delete.tcl +++ b/lib/remote_branch_delete.tcl @@ -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/lib/transport.tcl b/lib/transport.tcl index 8e6a9d0..e419d78 100644 --- a/lib/transport.tcl +++ b/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 \ -- cgit v0.10.2-6-g49f6 From 902e2bb5b7473765acc388d051f5c1c7d42015d0 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 00:12:51 +0200 Subject: git-gui: Make input boxes in init/clone/open dialogs consistent Before, the input boxes would not be sunken and would have larger border, which is inconsistent with the rest of the inputboxes for repository locations in the git-gui UI. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl index f54d88a..9091316 100644 --- a/lib/choose_repository.tcl +++ b/lib/choose_repository.tcl @@ -381,7 +381,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"] \ @@ -466,7 +467,8 @@ method _do_clone {} { 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"] \ @@ -476,7 +478,8 @@ method _do_clone {} { 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 +982,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"] \ -- cgit v0.10.2-6-g49f6 From 2243ffcc6a445d1953297949e8e944fdc3df6ed7 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 01:32:47 +0200 Subject: git-gui: Fix removing non-pushable remotes Git-gui does not add most of the remotes to the 'push' menu since they are missing the "Push" line in their remotespec. In that case, removing the remote would end up with an error. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/lib/remote.tcl b/lib/remote.tcl index 1852247..b92b429 100644 --- a/lib/remote.tcl +++ b/lib/remote.tcl @@ -271,5 +271,6 @@ proc remove_remote {name} { delete_from_menu $remote_m.fetch $name delete_from_menu $remote_m.prune $name delete_from_menu $remote_m.remove $name - delete_from_menu $remote_m.push $name + # Not all remotes are in the push menu + catch { delete_from_menu $remote_m.push $name } } -- cgit v0.10.2-6-g49f6 From 0b32cab933e0d3d1e85d4cb86669e33ef478ef66 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 01:39:13 +0200 Subject: git-gui: Fix fetching from remotes when adding them As you can see, this particular code branch did not see a lot of testing for some time now. Apologies for that. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce diff --git a/lib/remote_add.tcl b/lib/remote_add.tcl index 8e3ad16..fb29422 100644 --- a/lib/remote_add.tcl +++ b/lib/remote_add.tcl @@ -130,9 +130,9 @@ method _add {} { switch -- $opt_action { fetch { set c [console::new \ - [mc "fetch %s" $remote] \ - [mc "Fetching the %s" $remote]] - console::exec $c [list git fetch --all $name] + [mc "fetch %s" $name] \ + [mc "Fetching the %s" $name]] + console::exec $c [list git fetch $name] } push { set cmds [list] -- cgit v0.10.2-6-g49f6 From a910898e86be79c580d1e643cdbee8a19a7cd691 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 8 Oct 2008 10:03:54 +0200 Subject: git-gui: Fix switch statement in lib/merge.tcl 0aea2842 (Make Ctrl-T safe to use for conflicting files) introduced a new case, but forgot the '-' to indicate that it shares the body with the subsequent case label. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/merge.tcl b/lib/merge.tcl index ac4c7de..283e491 100644 --- a/lib/merge.tcl +++ b/lib/merge.tcl @@ -40,7 +40,7 @@ The rescan will be automatically started now. _O { continue; # and pray it works! } - _U + _U - U? { error_popup [mc "You are in the middle of a conflicted merge. -- cgit v0.10.2-6-g49f6 From d4d992562e8c6d27ac584ff0907ff840030a98d9 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 3 Oct 2008 11:36:52 +0400 Subject: git-gui: Fix the blame window shape. On modern high-resolution monitors the blame viewer window is very high, yet too narrow. This patch makes it gravitate to a more sane resolution, which takes the font size into account. It also changes the default text view size to 80% of the window, and slightly modifies the border decorations for better appearance. Signed-off-by: Alexander Gavrilov Signed-off-by: Shawn O. Pearce diff --git a/lib/blame.tcl b/lib/blame.tcl index eb61374..221313c 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -69,6 +69,8 @@ constructor new {i_commit i_path i_jump} { 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 +116,9 @@ constructor new {i_commit i_path i_jump} { 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 \ @@ -328,9 +330,14 @@ constructor new {i_commit i_path i_jump} { 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 @@ -338,7 +345,7 @@ constructor new {i_commit i_path i_jump} { 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 \ "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}" -- cgit v0.10.2-6-g49f6 From f10d5b064ae5c9bcd6e353211f128f5c4072ed4f Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 3 Oct 2008 11:36:53 +0400 Subject: git-gui: Add a search command to the blame viewer. One of the largest deficiencies in the blame viewer at the moment is the impossibility to search for a text string. This commit fixes it by adding a Firefox-like search panel to the viewer. The panel can be shown by pressing F7 or clicking a menu entry, and is hidden by pressing Esc. Find Next is available through the F3 key. Implementation is based on the gitk code, but heavily refactored. It now also supports case-insensitive searches, and uses the text box background color to signal success or failure of the search. Signed-off-by: Alexander Gavrilov Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 79a108d..4f95139 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -591,6 +591,7 @@ bind . { if {[is_Windows]} { wm iconbitmap . -default $oguilib/git-gui.ico + set ::tk::AlwaysShowSelection 1 } ###################################################################### @@ -1067,6 +1068,8 @@ set selected_commit_type new set nullid "0000000000000000000000000000000000000000" set nullid2 "0000000000000000000000000000000000000001" +set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}] + ###################################################################### ## ## task management diff --git a/lib/blame.tcl b/lib/blame.tcl index 221313c..a45784c 100644 --- a/lib/blame.tcl +++ b/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 @@ -59,7 +61,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip field tooltip_commit {} ; # Commit(s) in tooltip constructor new {i_commit i_path i_jump} { - global cursor_ptr + global cursor_ptr M1B M1T have_tk85 variable active_color variable group_colors @@ -199,6 +201,11 @@ constructor new {i_commit i_path i_jump} { -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] @@ -219,6 +226,11 @@ constructor new {i_commit i_path i_jump} { -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 \ @@ -259,6 +271,10 @@ constructor new {i_commit i_path i_jump} { -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 \ @@ -280,9 +296,15 @@ constructor new {i_commit i_path i_jump} { $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 " [cb _hide_tooltip] [cb _click $i @%x,%y] @@ -319,6 +341,11 @@ constructor new {i_commit i_path i_jump} { bind $w_cviewer "[list focus $w_file];break" bind $w_cviewer [list focus $w_cviewer] bind $w_file [list focus $w_file] + bind $top [list searchbar::show $finder] + bind $top [list searchbar::hide $finder] + bind $top [list searchbar::find_next $finder] + bind $top [list searchbar::find_prev $finder] + catch { bind $top [list searchbar::find_prev $finder] } grid configure $w.header -sticky ew grid configure $w.file_pane -sticky nsew @@ -873,6 +900,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 {} diff --git a/lib/search.tcl b/lib/search.tcl new file mode 100644 index 0000000..d292f20 --- /dev/null +++ b/lib/search.tcl @@ -0,0 +1,190 @@ +# 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:] + 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] + entry $w.ent -textvariable ${__this}::searchstring -background lightgreen + 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 [cb delete_this] + return $this +} + +method show {} { + if {![winfo ismapped $w]} { + grid $w + } + focus -force $w.ent +} + +method hide {} { + if {[winfo ismapped $w]} { + focus $ctext + grid remove $w + } +} + +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 -- cgit v0.10.2-6-g49f6 From 5c91cb5d0dd06aa5574234a3d651098393adb4fa Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 3 Oct 2008 11:36:54 +0400 Subject: git-gui: Fix the blame viewer destroy handler. It did not delete the object, which is not very good. Also, destroy may be fired up for subwindows, so we should check %W. Signed-off-by: Alexander Gavrilov Signed-off-by: Shawn O. Pearce diff --git a/lib/blame.tcl b/lib/blame.tcl index a45784c..765d08c 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -377,11 +377,18 @@ constructor new {i_commit i_path i_jump} { "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}" wm protocol $top WM_DELETE_WINDOW "destroy $top" - bind $top [cb _kill] + bind $top [cb _handle_destroy %W] _load $this $i_jump } +method _handle_destroy {win} { + if {$win eq $w} { + _kill $this + delete_this + } +} + method _kill {} { if {$current_fd ne {}} { kill_file_process $current_fd -- cgit v0.10.2-6-g49f6 From f2df8a5bfb6b766b0362a2cb545d5226a268bf37 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 3 Oct 2008 10:28:49 +0200 Subject: git-gui: Show a round number of bytes of large untracked text files If an untracked text file is selected, then its contents are displayed instead of a diff. If the file is large, then the following hint is inserted at the top: * Untracked file is 14774881 bytes. * Showing only first 131072 bytes. Why exactly 131072 bytes? With this patch it is 100000 bytes. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/diff.tcl b/lib/diff.tcl index abe502d..6e08704 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -164,7 +164,7 @@ proc show_other_diff {path w m cont_info} { # - 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] -- cgit v0.10.2-6-g49f6 From 7f15b0027392155f5b3260bb584ba37126232bf1 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 3 Oct 2008 13:13:42 +0200 Subject: git-gui: Mark-up strings in show_{other,unmerged}_diff() for localization Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/diff.tcl b/lib/diff.tcl index 6e08704..bdcbbf8 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -117,22 +117,22 @@ proc show_unmerged_diff {cont_info} { if {$merge_stages(2) eq {}} { set is_conflict_diff 1 lappend current_diff_queue \ - [list "LOCAL: deleted\nREMOTE:\n" d======= \ + [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 "REMOTE: deleted\nLOCAL:\n" d======= \ + [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 "LOCAL:\n" d======= \ + [list [mc "LOCAL:\n"] d======= \ [list ":1:$current_diff_path" ":2:$current_diff_path"]] lappend current_diff_queue \ - [list "REMOTE:\n" d======= \ + [list [mc "REMOTE:\n"] d======= \ [list ":1:$current_diff_path" ":3:$current_diff_path"]] } else { start_show_diff $cont_info @@ -218,17 +218,17 @@ proc show_other_diff {path w m cont_info} { 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 -- cgit v0.10.2-6-g49f6 From 98a6846bb8c5acb55d25d429954ec4ea2f4f320e Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 15 Oct 2008 13:28:20 +0400 Subject: git-gui: Add a dialog that shows the OpenSSH public key. Generating a new SSH key or finding an existing one may be a difficult task for non-technical users, especially on Windows. This commit adds a new dialog that shows the public key, or allows the user to generate a new one if none were found. Since this is a convenience/informational feature for new users, and the dialog is mostly read-only, it is located in the Help menu. The command line used to invoke ssh-keygen is designed to force it to use SSH_ASKPASS if available, or accept empty passphrases, but _never_ wait for user response on the tty. Signed-off-by: Alexander Gavrilov Acked-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 4f95139..e4d1f70 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2536,6 +2536,10 @@ proc start_browser {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 diff --git a/lib/sshkey.tcl b/lib/sshkey.tcl new file mode 100644 index 0000000..82a1a80 --- /dev/null +++ b/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 "grab $w; focus $w.buttons.close" + bind $w "destroy $w" + bind $w "destroy $w" + bind $w 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 +} -- cgit v0.10.2-6-g49f6 From 8c76212529570aed70c46d6f252cb1a4010f3f2e Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 15 Oct 2008 13:28:21 +0400 Subject: git-gui: Add a simple implementation of SSH_ASKPASS. OpenSSH allows specifying an external program to use for direct user interaction. While most Linux systems already have such programs, some environments, for instance, msysgit, lack it. This patch adds a simple fallback Tcl implementation of the tool. In msysgit it is also necessary to set a fake value of the DISPLAY variable, because otherwise ssh won't even try to use SSH_ASKPASS handlers. Signed-off-by: Alexander Gavrilov Acked-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/Makefile b/Makefile index 55765c8..3ad8a21 100644 --- a/Makefile +++ b/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--askpass b/git-gui--askpass new file mode 100755 index 0000000..12e117e --- /dev/null +++ b/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 . {focus -force .e} +bind . finish +bind . {destroy .} +bind . {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.sh b/git-gui.sh index e4d1f70..12b496b 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -592,6 +592,11 @@ bind . { 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 + } } ###################################################################### @@ -1071,6 +1076,13 @@ set nullid2 "0000000000000000000000000000000000000001" 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] +} + +###################################################################### ## ## task management -- cgit v0.10.2-6-g49f6 From 63aa1d0cb78e8fcf36ea2b8b65750d9a45d59f63 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 14 Oct 2008 13:48:37 +0200 Subject: git-gui: Do not munge conflict marker lines in a normal diff Previously, conflict markers were highlighted in two ways: (1) They received a distinguishing color; and (2) they had the '+' removed at the beginning of the line. However, by doing (2), a hunk that contained conflict markers could not be staged or unstaged because the resulting patch was corrupted. With this change we no longer modify the diff text of a 2-way diff, so that "Stage Hunk" and friends work. Note that 3-way diff of a conflicted file is unaffected by this change, and '++' before conflict markers is still removed. But this has no negative impact because in this mode staging hunks or lines is disabled anyway. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/diff.tcl b/lib/diff.tcl index bdcbbf8..94ee38c 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -377,7 +377,6 @@ proc read_diff {fd cont_info} { {+} { if {[regexp {^\+([<>]{7} |={7})} $line _g op]} { set is_conflict_diff 1 - set line [string replace $line 0 0 { }] set tags d$op } else { set tags d_+ -- cgit v0.10.2-6-g49f6 From 9d83c6aa44d2ff68111865b6f72e7321e54a8972 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sat, 25 Oct 2008 22:51:05 +0200 Subject: git-gui: Update German translation. Not yet completed, though. Signed-off-by: Christian Stimming Signed-off-by: Shawn O. Pearce diff --git a/po/de.po b/po/de.po index 793cca1..5c04812 100644 --- a/po/de.po +++ b/po/de.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: git-gui\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-09-13 10:20+0200\n" -"PO-Revision-Date: 2008-09-13 10:24+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 \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." @@ -170,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" @@ -267,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" @@ -307,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..." @@ -319,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" @@ -416,7 +442,11 @@ msgstr "Schriftgröße verkleinern" msgid "Increase Font Size" msgstr "Schriftgröße vergrößern" -#: git-gui.sh:2870 +#: git-gui.sh:3033 lib/blame.tcl:281 +msgid "Encoding" +msgstr "Zeichenkodierung" + +#: git-gui.sh:3044 msgid "Apply/Reverse Hunk" msgstr "Kontext anwenden/umkehren" @@ -440,11 +470,7 @@ msgstr "Lokale Version benutzen" msgid "Revert To Base" msgstr "Ursprüngliche Version benutzen" -#: git-gui.sh:2906 -msgid "Stage Working Copy" -msgstr "Arbeitskopie bereitstellen" - -#: git-gui.sh:2925 +#: git-gui.sh:3091 msgid "Unstage Hunk From Commit" msgstr "Kontext aus Bereitstellung herausnehmen" @@ -583,7 +609,12 @@ msgstr "Eintragender:" msgid "Original File:" msgstr "Ursprüngliche Datei:" -#: lib/blame.tcl:990 +#: 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:" @@ -1041,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:" @@ -1525,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" @@ -1542,7 +1597,22 @@ msgstr "Git-Projektarchiv (Unterprojekt)" msgid "* Binary file (not showing content)." msgstr "* Binärdatei (Inhalt wird nicht angezeigt)" -#: lib/diff.tcl:313 +#: 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:437 msgid "Failed to unstage selected hunk." msgstr "" "Fehler beim Herausnehmen des gewählten Kontexts aus der Bereitstellung." @@ -1559,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" @@ -1811,7 +1894,12 @@ msgstr "" "Diese Operation kann nur rückgängig gemacht werden, wenn die\n" "Zusammenführung erneut gestartet wird." -#: lib/mergetool.tcl:32 +#: 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" @@ -1868,12 +1956,17 @@ msgstr "Zusammenführungswerkzeug starten..." msgid "Merge tool failed." msgstr "Zusammenführungswerkzeug fehlgeschlagen." -#: lib/mergetool.tcl:353 +#: lib/option.tcl:11 +#, tcl-format +msgid "Invalid global encoding '%s'" +msgstr "Ungültige globale Zeichenkodierung »%s«" + +#: lib/option.tcl:19 #, tcl-format -msgid "File %s unchanged, still accept as resolved?" -msgstr "Datei »%s« unverändert. Trotzdem Konflikt als gelöst akzeptieren?" +msgid "Invalid repo encoding '%s'" +msgstr "Ungültige Archiv-Zeichenkodierung »%s«" -#: lib/option.tcl:95 +#: lib/option.tcl:117 msgid "Restore Defaults" msgstr "Voreinstellungen wiederherstellen" @@ -1950,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:" @@ -1975,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" @@ -1988,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" @@ -2061,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" @@ -2073,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:" @@ -2123,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" @@ -2143,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" -- cgit v0.10.2-6-g49f6