Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Force the focus to the main window on Windows
  gitk: Allow unbalanced quotes/braces in commit headers
  gitk: Update German translation
  gitk: Mark forgotten strings (header sentence parts in color chooser) for translation
  gitk: Ensure that "Reset branch" menu entry is enabled
  gitk: Use check-buttons' -text property instead of separate labels
  gitk: Map / to focus the search box
  gitk: Fix bugs in blaming code
This commit is contained in:
Junio C Hamano
2008-12-21 18:31:12 -08:00
2 changed files with 213 additions and 63 deletions

View File

@ -1601,13 +1601,14 @@ proc parsecommit {id contents listed} {
set header [string range $contents 0 [expr {$hdrend - 1}]] set header [string range $contents 0 [expr {$hdrend - 1}]]
set comment [string range $contents [expr {$hdrend + 2}] end] set comment [string range $contents [expr {$hdrend + 2}] end]
foreach line [split $header "\n"] { foreach line [split $header "\n"] {
set line [split $line " "]
set tag [lindex $line 0] set tag [lindex $line 0]
if {$tag == "author"} { if {$tag == "author"} {
set audate [lindex $line end-1] set audate [lindex $line end-1]
set auname [lrange $line 1 end-2] set auname [join [lrange $line 1 end-2] " "]
} elseif {$tag == "committer"} { } elseif {$tag == "committer"} {
set comdate [lindex $line end-1] set comdate [lindex $line end-1]
set comname [lrange $line 1 end-2] set comname [join [lrange $line 1 end-2] " "]
} }
} }
set headline {} set headline {}
@ -2279,7 +2280,7 @@ proc makewindow {} {
bindkey b prevfile bindkey b prevfile
bindkey d "$ctext yview scroll 18 units" bindkey d "$ctext yview scroll 18 units"
bindkey u "$ctext yview scroll -18 units" bindkey u "$ctext yview scroll -18 units"
bindkey / {dofind 1 1} bindkey / {focus $fstring}
bindkey <Key-Return> {dofind 1 1} bindkey <Key-Return> {dofind 1 1}
bindkey ? {dofind -1 1} bindkey ? {dofind -1 1}
bindkey f nextfile bindkey f nextfile
@ -2660,7 +2661,7 @@ proc keys {} {
[mc "<%s-F> Find" $M1T] [mc "<%s-F> Find" $M1T]
[mc "<%s-G> Move to next find hit" $M1T] [mc "<%s-G> Move to next find hit" $M1T]
[mc "<Return> Move to next find hit"] [mc "<Return> Move to next find hit"]
[mc "/ Move to next find hit, or redo find"] [mc "/ Focus the search box"]
[mc "? Move to previous find hit"] [mc "? Move to previous find hit"]
[mc "f Scroll diff view to next file"] [mc "f Scroll diff view to next file"]
[mc "<%s-S> Search for next hit in diff view" $M1T] [mc "<%s-S> Search for next hit in diff view" $M1T]
@ -3318,8 +3319,27 @@ proc index_sha1 {fname} {
return {} return {}
} }
# Turn an absolute path into one relative to the current directory
proc make_relative {f} {
set elts [file split $f]
set here [file split [pwd]]
set ei 0
set hi 0
set res {}
foreach d $here {
if {$ei < $hi || $ei >= [llength $elts] || [lindex $elts $ei] ne $d} {
lappend res ".."
} else {
incr ei
}
incr hi
}
set elts [concat $res [lrange $elts $ei end]]
return [eval file join $elts]
}
proc external_blame {parent_idx {line {}}} { proc external_blame {parent_idx {line {}}} {
global flist_menu_file global flist_menu_file gitdir
global nullid nullid2 global nullid nullid2
global parentlist selectedline currentid global parentlist selectedline currentid
@ -3338,7 +3358,12 @@ proc external_blame {parent_idx {line {}}} {
if {$line ne {} && $line > 1} { if {$line ne {} && $line > 1} {
lappend cmdline "--line=$line" lappend cmdline "--line=$line"
} }
lappend cmdline $base_commit $flist_menu_file set f [file join [file dirname $gitdir] $flist_menu_file]
# Unfortunately it seems git gui blame doesn't like
# being given an absolute path...
set f [make_relative $f]
lappend cmdline $base_commit $f
puts "cmdline={$cmdline}"
if {[catch {eval exec $cmdline &} err]} { if {[catch {eval exec $cmdline &} err]} {
error_popup "[mc "git gui blame: command failed:"] $err" error_popup "[mc "git gui blame: command failed:"] $err"
} }
@ -3382,6 +3407,8 @@ proc show_line_source {} {
error_popup [mc "Error reading index: %s" $err] error_popup [mc "Error reading index: %s" $err]
return return
} }
} else {
set id $parents($curview,$currentid)
} }
} else { } else {
set id [lindex $parents($curview,$currentid) $pi] set id [lindex $parents($curview,$currentid) $pi]
@ -3398,7 +3425,7 @@ proc show_line_source {} {
} else { } else {
lappend blameargs $id lappend blameargs $id
} }
lappend blameargs -- $flist_menu_file lappend blameargs -- [file join [file dirname $gitdir] $flist_menu_file]
if {[catch { if {[catch {
set f [open $blameargs r] set f [open $blameargs r]
} err]} { } err]} {
@ -7953,7 +7980,7 @@ proc rowmenu {x y id} {
if {$id ne $nullid && $id ne $nullid2} { if {$id ne $nullid && $id ne $nullid2} {
set menu $rowctxmenu set menu $rowctxmenu
if {$mainhead ne {}} { if {$mainhead ne {}} {
$menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead] $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead] -state normal
} else { } else {
$menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled $menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled
} }
@ -10079,15 +10106,11 @@ proc doprefs {} {
-font optionfont -font optionfont
spinbox $top.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct spinbox $top.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct
grid x $top.maxpctl $top.maxpct -sticky w grid x $top.maxpctl $top.maxpct -sticky w
frame $top.showlocal checkbutton $top.showlocal -text [mc "Show local changes"] \
label $top.showlocal.l -text [mc "Show local changes"] -font optionfont -font optionfont -variable showlocalchanges
checkbutton $top.showlocal.b -variable showlocalchanges
pack $top.showlocal.b $top.showlocal.l -side left
grid x $top.showlocal -sticky w grid x $top.showlocal -sticky w
frame $top.autoselect checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
label $top.autoselect.l -text [mc "Auto-select SHA1"] -font optionfont -font optionfont -variable autoselect
checkbutton $top.autoselect.b -variable autoselect
pack $top.autoselect.b $top.autoselect.l -side left
grid x $top.autoselect -sticky w grid x $top.autoselect -sticky w
label $top.ddisp -text [mc "Diff display options"] label $top.ddisp -text [mc "Diff display options"]
@ -10095,20 +10118,14 @@ proc doprefs {} {
label $top.tabstopl -text [mc "Tab spacing"] -font optionfont label $top.tabstopl -text [mc "Tab spacing"] -font optionfont
spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $top.tabstopl $top.tabstop -sticky w grid x $top.tabstopl $top.tabstop -sticky w
frame $top.ntag checkbutton $top.ntag -text [mc "Display nearby tags"] \
label $top.ntag.l -text [mc "Display nearby tags"] -font optionfont -font optionfont -variable showneartags
checkbutton $top.ntag.b -variable showneartags
pack $top.ntag.b $top.ntag.l -side left
grid x $top.ntag -sticky w grid x $top.ntag -sticky w
frame $top.ldiff checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
label $top.ldiff.l -text [mc "Limit diffs to listed paths"] -font optionfont -font optionfont -variable limitdiffs
checkbutton $top.ldiff.b -variable limitdiffs
pack $top.ldiff.b $top.ldiff.l -side left
grid x $top.ldiff -sticky w grid x $top.ldiff -sticky w
frame $top.lattr checkbutton $top.lattr -text [mc "Support per-file encodings"] \
label $top.lattr.l -text [mc "Support per-file encodings"] -font optionfont -font optionfont -variable perfile_attrs
checkbutton $top.lattr.b -variable perfile_attrs
pack $top.lattr.b $top.lattr.l -side left
grid x $top.lattr -sticky w grid x $top.lattr -sticky w
entry $top.extdifft -textvariable extdifftool entry $top.extdifft -textvariable extdifftool
@ -10124,26 +10141,26 @@ proc doprefs {} {
grid $top.cdisp - -sticky w -pady 10 grid $top.cdisp - -sticky w -pady 10
label $top.bg -padx 40 -relief sunk -background $bgcolor label $top.bg -padx 40 -relief sunk -background $bgcolor
button $top.bgbut -text [mc "Background"] -font optionfont \ button $top.bgbut -text [mc "Background"] -font optionfont \
-command [list choosecolor bgcolor {} $top.bg background setbg] -command [list choosecolor bgcolor {} $top.bg [mc "background"] setbg]
grid x $top.bgbut $top.bg -sticky w grid x $top.bgbut $top.bg -sticky w
label $top.fg -padx 40 -relief sunk -background $fgcolor label $top.fg -padx 40 -relief sunk -background $fgcolor
button $top.fgbut -text [mc "Foreground"] -font optionfont \ button $top.fgbut -text [mc "Foreground"] -font optionfont \
-command [list choosecolor fgcolor {} $top.fg foreground setfg] -command [list choosecolor fgcolor {} $top.fg [mc "foreground"] setfg]
grid x $top.fgbut $top.fg -sticky w grid x $top.fgbut $top.fg -sticky w
label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0] label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0]
button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \ button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \
-command [list choosecolor diffcolors 0 $top.diffold "diff old lines" \ -command [list choosecolor diffcolors 0 $top.diffold [mc "diff old lines"] \
[list $ctext tag conf d0 -foreground]] [list $ctext tag conf d0 -foreground]]
grid x $top.diffoldbut $top.diffold -sticky w grid x $top.diffoldbut $top.diffold -sticky w
label $top.diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1] label $top.diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1]
button $top.diffnewbut -text [mc "Diff: new lines"] -font optionfont \ button $top.diffnewbut -text [mc "Diff: new lines"] -font optionfont \
-command [list choosecolor diffcolors 1 $top.diffnew "diff new lines" \ -command [list choosecolor diffcolors 1 $top.diffnew [mc "diff new lines"] \
[list $ctext tag conf dresult -foreground]] [list $ctext tag conf dresult -foreground]]
grid x $top.diffnewbut $top.diffnew -sticky w grid x $top.diffnewbut $top.diffnew -sticky w
label $top.hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2] label $top.hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2]
button $top.hunksepbut -text [mc "Diff: hunk header"] -font optionfont \ button $top.hunksepbut -text [mc "Diff: hunk header"] -font optionfont \
-command [list choosecolor diffcolors 2 $top.hunksep \ -command [list choosecolor diffcolors 2 $top.hunksep \
"diff hunk header" \ [mc "diff hunk header"] \
[list $ctext tag conf hunksep -foreground]] [list $ctext tag conf hunksep -foreground]]
grid x $top.hunksepbut $top.hunksep -sticky w grid x $top.hunksepbut $top.hunksep -sticky w
label $top.markbgsep -padx 40 -relief sunk -background $markbgcolor label $top.markbgsep -padx 40 -relief sunk -background $markbgcolor
@ -10154,7 +10171,7 @@ proc doprefs {} {
grid x $top.markbgbut $top.markbgsep -sticky w grid x $top.markbgbut $top.markbgsep -sticky w
label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor
button $top.selbgbut -text [mc "Select bg"] -font optionfont \ button $top.selbgbut -text [mc "Select bg"] -font optionfont \
-command [list choosecolor selectbgcolor {} $top.selbgsep background setselbg] -command [list choosecolor selectbgcolor {} $top.selbgsep [mc "background"] setselbg]
grid x $top.selbgbut $top.selbgsep -sticky w grid x $top.selbgbut $top.selbgsep -sticky w
label $top.cfont -text [mc "Fonts: press to choose"] label $top.cfont -text [mc "Fonts: press to choose"]
@ -10897,4 +10914,9 @@ if {[info exists permviews]} {
addviewmenu $n addviewmenu $n
} }
} }
if {[tk windowingsystem] eq "win32"} {
focus -force .
}
getcommits {} getcommits {}

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: git-gui\n" "Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-10-25 13:18+0200\n" "POT-Creation-Date: 2008-12-06 20:40+0100\n"
"PO-Revision-Date: 2008-10-25 13:23+0200\n" "PO-Revision-Date: 2008-12-06 20:45+0100\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n" "Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -90,7 +90,11 @@ msgstr "Zweige neu laden"
msgid "List references" msgid "List references"
msgstr "Zweige/Markierungen auflisten" msgstr "Zweige/Markierungen auflisten"
#: gitk:1815 #: gitk:1915
msgid "Start git gui"
msgstr "»git gui« starten"
#: gitk:1917
msgid "Quit" msgid "Quit"
msgstr "Beenden" msgstr "Beenden"
@ -295,7 +299,15 @@ msgstr "Externer Vergleich"
msgid "Blame parent commit" msgid "Blame parent commit"
msgstr "Annotieren der Elternversion" msgstr "Annotieren der Elternversion"
#: gitk:2488 #: gitk:2360
msgid "Show origin of this line"
msgstr "Herkunft dieser Zeile anzeigen"
#: gitk:2361
msgid "Run git gui blame on this line"
msgstr "Annotieren (»git gui blame«) von dieser Zeile"
#: gitk:2606
msgid "" msgid ""
"\n" "\n"
"Gitk - a commit viewer for git\n" "Gitk - a commit viewer for git\n"
@ -501,7 +513,38 @@ msgstr "Version nicht gefunden"
msgid "git gui blame: command failed:" msgid "git gui blame: command failed:"
msgstr "git gui blame: Kommando fehlgeschlagen:" msgstr "git gui blame: Kommando fehlgeschlagen:"
#: gitk:3092 #: gitk:3398
#, tcl-format
msgid "Couldn't read merge head: %s"
msgstr "Zusammenführungs-Spitze konnte nicht gelesen werden: %s"
#: gitk:3406
#, tcl-format
msgid "Error reading index: %s"
msgstr "Fehler beim Lesen der Bereitstellung (»index«): %s"
#: gitk:3431
#, tcl-format
msgid "Couldn't start git blame: %s"
msgstr "»git blame« konnte nicht gestartet werden: %s"
#: gitk:3434 gitk:6160
msgid "Searching"
msgstr "Suchen"
#: gitk:3466
#, tcl-format
msgid "Error running git blame: %s"
msgstr "Fehler beim Ausführen von »git blame«: %s"
#: gitk:3494
#, tcl-format
msgid "That line comes from commit %s, which is not in this view"
msgstr ""
"Diese Zeile stammt aus Version %s, welche nicht in dieser Ansicht gezeigt "
"wird."
#: gitk:3508
msgid "External diff viewer failed:" msgid "External diff viewer failed:"
msgstr "Externes Vergleich-(Diff-)Programm fehlgeschlagen:" msgstr "Externes Vergleich-(Diff-)Programm fehlgeschlagen:"
@ -509,11 +552,7 @@ msgstr "Externes Vergleich-(Diff-)Programm fehlgeschlagen:"
msgid "Gitk view definition" msgid "Gitk view definition"
msgstr "Gitk Ansichten" msgstr "Gitk Ansichten"
#: gitk:3225 #: gitk:3630
msgid "Name"
msgstr "Name"
#: gitk:3228
msgid "Remember this view" msgid "Remember this view"
msgstr "Diese Ansicht speichern" msgstr "Diese Ansicht speichern"
@ -521,15 +560,55 @@ msgstr "Diese Ansicht speichern"
msgid "Commits to include (arguments to git log):" msgid "Commits to include (arguments to git log):"
msgstr "Versionen anzeigen (Argumente von git-log):" msgstr "Versionen anzeigen (Argumente von git-log):"
#: gitk:3239 #: gitk:3632
msgid "Use all refs"
msgstr "Alle Zweige verwenden"
#: gitk:3633
msgid "Strictly sort by date"
msgstr "Streng nach Datum sortieren"
#: gitk:3634
msgid "Mark branch sides"
msgstr "Zweig-Seiten markieren"
#: gitk:3635
msgid "Since date:"
msgstr "Von Datum:"
#: gitk:3636
msgid "Until date:"
msgstr "Bis Datum:"
#: gitk:3637
msgid "Max count:"
msgstr "Max. Anzahl:"
#: gitk:3638
msgid "Skip:"
msgstr "Überspringen:"
#: gitk:3639
msgid "Limit to first parent"
msgstr "Auf erste Elternversion beschränken"
#: gitk:3640
msgid "Command to generate more commits to include:" msgid "Command to generate more commits to include:"
msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:" msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:"
#: gitk:3246 #: gitk:3749
msgid "Name"
msgstr "Name"
#: gitk:3797
msgid "Enter files and directories to include, one per line:" msgid "Enter files and directories to include, one per line:"
msgstr "Folgende Dateien und Verzeichnisse anzeigen (eine pro Zeile):" msgstr "Folgende Dateien und Verzeichnisse anzeigen (eine pro Zeile):"
#: gitk:3293 #: gitk:3811
msgid "Apply (F5)"
msgstr "Anwenden (F5)"
#: gitk:3849
msgid "Error in commit selection arguments:" msgid "Error in commit selection arguments:"
msgstr "Fehler in den ausgewählten Versionen:" msgstr "Fehler in den ausgewählten Versionen:"
@ -569,11 +648,7 @@ msgstr "Lokale Änderungen bereitgestellt, aber nicht eingetragen"
msgid "Local uncommitted changes, not checked in to index" msgid "Local uncommitted changes, not checked in to index"
msgstr "Lokale Änderungen, nicht bereitgestellt" msgstr "Lokale Änderungen, nicht bereitgestellt"
#: gitk:5549 #: gitk:6673
msgid "Searching"
msgstr "Suchen"
#: gitk:6049
msgid "Tags:" msgid "Tags:"
msgstr "Markierungen:" msgstr "Markierungen:"
@ -597,11 +672,12 @@ msgstr "Folgt auf"
msgid "Precedes" msgid "Precedes"
msgstr "Vorgänger von" msgstr "Vorgänger von"
#: gitk:6378 #: gitk:7209
msgid "Error getting merge diffs:" #, tcl-format
msgstr "Fehler beim Laden des Vergleichs:" msgid "Error getting diffs: %s"
msgstr "Fehler beim Laden des Vergleichs: %s"
#: gitk:7113 #: gitk:7748
msgid "Goto:" msgid "Goto:"
msgstr "Gehe zu:" msgstr "Gehe zu:"
@ -722,7 +798,12 @@ msgstr "Name:"
msgid "Please specify a name for the new branch" msgid "Please specify a name for the new branch"
msgstr "Bitte geben Sie einen Namen für den neuen Zweig an." msgstr "Bitte geben Sie einen Namen für den neuen Zweig an."
#: gitk:7703 #: gitk:8328
#, tcl-format
msgid "Branch '%s' already exists. Overwrite?"
msgstr "Zweig »%s« existiert bereits. Soll er überschrieben werden?"
#: gitk:8394
#, tcl-format #, tcl-format
msgid "Commit %s is already included in branch %s -- really re-apply it?" msgid "Commit %s is already included in branch %s -- really re-apply it?"
msgstr "" msgstr ""
@ -733,7 +814,26 @@ msgstr ""
msgid "Cherry-picking" msgid "Cherry-picking"
msgstr "Version pflücken" msgstr "Version pflücken"
#: gitk:7720 #: gitk:8408
#, tcl-format
msgid ""
"Cherry-pick failed because of local changes to file '%s'.\n"
"Please commit, reset or stash your changes and try again."
msgstr ""
"Pflücken fehlgeschlagen, da noch lokale Änderungen in Datei »%s«\n"
"vorliegen. Bitte diese Änderungen eintragen, zurücksetzen oder\n"
"zwischenspeichern (»git stash») und dann erneut versuchen."
#: gitk:8414
msgid ""
"Cherry-pick failed because of merge conflict.\n"
"Do you wish to run git citool to resolve it?"
msgstr ""
"Pflücken fehlgeschlagen, da ein Zusammenführungs-Konflikt aufgetreten\n"
"ist. Soll das »git citool« (Zusammenführungs-Werkzeug) aufgerufen\n"
"werden, um diesen Konflikt aufzulösen?"
#: gitk:8430
msgid "No changes committed" msgid "No changes committed"
msgstr "Keine Änderungen eingetragen" msgstr "Keine Änderungen eingetragen"
@ -889,23 +989,51 @@ msgstr "Farben: Klicken zum Wählen"
msgid "Background" msgid "Background"
msgstr "Hintergrund" msgstr "Hintergrund"
#: gitk:9435 #: gitk:10153 gitk:10183
msgid "background"
msgstr "Hintergrund"
#: gitk:10156
msgid "Foreground" msgid "Foreground"
msgstr "Vordergrund" msgstr "Vordergrund"
#: gitk:9439 #: gitk:10157
msgid "foreground"
msgstr "Vordergrund"
#: gitk:10160
msgid "Diff: old lines" msgid "Diff: old lines"
msgstr "Vergleich: Alte Zeilen" msgstr "Vergleich: Alte Zeilen"
#: gitk:9444 #: gitk:10161
msgid "diff old lines"
msgstr "Vergleich - Alte Zeilen"
#: gitk:10165
msgid "Diff: new lines" msgid "Diff: new lines"
msgstr "Vergleich: Neue Zeilen" msgstr "Vergleich: Neue Zeilen"
#: gitk:9449 #: gitk:10166
msgid "diff new lines"
msgstr "Vergleich - Neue Zeilen"
#: gitk:10170
msgid "Diff: hunk header" msgid "Diff: hunk header"
msgstr "Vergleich: Änderungstitel" msgstr "Vergleich: Änderungstitel"
#: gitk:9455 #: gitk:10172
msgid "diff hunk header"
msgstr "Vergleich - Änderungstitel"
#: gitk:10176
msgid "Marked line bg"
msgstr "Markierte Zeile Hintergrund"
#: gitk:10178
msgid "marked line background"
msgstr "markierte Zeile Hintergrund"
#: gitk:10182
msgid "Select bg" msgid "Select bg"
msgstr "Hintergrundfarbe Auswählen" msgstr "Hintergrundfarbe Auswählen"