diff options
Diffstat (limited to 'gitk-git')
-rw-r--r-- | gitk-git/.gitignore | 2 | ||||
-rw-r--r-- | gitk-git/Makefile | 16 | ||||
-rwxr-xr-x | gitk-git/gitk | 735 | ||||
-rw-r--r-- | gitk-git/po/sv.po | 673 |
4 files changed, 879 insertions, 547 deletions
diff --git a/gitk-git/.gitignore b/gitk-git/.gitignore new file mode 100644 index 0000000000..d7ebcaf366 --- /dev/null +++ b/gitk-git/.gitignore @@ -0,0 +1,2 @@ +/GIT-TCLTK-VARS +/gitk-wish diff --git a/gitk-git/Makefile b/gitk-git/Makefile index e1b6045605..5acdc900ab 100644 --- a/gitk-git/Makefile +++ b/gitk-git/Makefile @@ -17,6 +17,16 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) bindir_SQ = $(subst ','\'',$(bindir)) TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) +### Detect Tck/Tk interpreter path changes +TRACK_TCLTK = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)') + +GIT-TCLTK-VARS: FORCE + @VARS='$(TRACK_TCLTK)'; \ + if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ + echo 1>&2 " * new Tcl/Tk interpreter location"; \ + echo "$$VARS" >$@; \ + fi + ## po-file creation rules XGETTEXT ?= xgettext ifdef NO_MSGFMT @@ -49,9 +59,9 @@ uninstall:: $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk clean:: - $(RM) gitk-wish po/*.msg + $(RM) gitk-wish po/*.msg GIT-TCLTK-VARS -gitk-wish: gitk +gitk-wish: gitk GIT-TCLTK-VARS $(QUIET_GEN)$(RM) $@ $@+ && \ sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \ chmod +x $@+ && \ @@ -65,3 +75,5 @@ $(ALL_MSGFILES): %.msg : %.po @echo Generating catalog $@ $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@) +.PHONY: all install uninstall clean update-po +.PHONY: FORCE diff --git a/gitk-git/gitk b/gitk-git/gitk index 4cde0c493b..b3706fc9b9 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -2,20 +2,45 @@ # Tcl ignores the next line -*- tcl -*- \ exec wish "$0" -- "$@" -# Copyright © 2005-2009 Paul Mackerras. All rights reserved. +# Copyright © 2005-2011 Paul Mackerras. All rights reserved. # This program is free software; it may be used, copied, modified # and distributed under the terms of the GNU General Public Licence, # either version 2, or (at your option) any later version. package require Tk -proc gitdir {} { - global env - if {[info exists env(GIT_DIR)]} { - return $env(GIT_DIR) - } else { - return [exec git rev-parse --git-dir] +proc hasworktree {} { + return [expr {[exec git rev-parse --is-bare-repository] == "false" && + [exec git rev-parse --is-inside-git-dir] == "false"}] +} + +proc reponame {} { + global gitdir + set n [file normalize $gitdir] + if {[string match "*/.git" $n]} { + set n [string range $n 0 end-5] } + return [file tail $n] +} + +proc gitworktree {} { + variable _gitworktree + if {[info exists _gitworktree]} { + return $_gitworktree + } + # v1.7.0 introduced --show-toplevel to return the canonical work-tree + if {[catch {set _gitworktree [exec git rev-parse --show-toplevel]}]} { + # try to set work tree from environment, core.worktree or use + # cdup to obtain a relative path to the top of the worktree. If + # run from the top, the ./ prefix ensures normalize expands pwd. + if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} { + catch {set _gitworktree [exec git config --get core.worktree]} + if {$_gitworktree eq ""} { + set _gitworktree [file normalize ./[exec git rev-parse --show-cdup]] + } + } + } + return $_gitworktree } # A simple scheduler for compute-intensive stuff. @@ -468,11 +493,11 @@ proc updatecommits {} { global viewactive viewcomplete tclencoding global startmsecs showneartags showlocalchanges global mainheadid viewmainheadid viewmainheadid_orig pending_select - global isworktree + global hasworktree global varcid vposids vnegids vflags vrevs global show_notes - set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}] + set hasworktree [hasworktree] rereadrefs set view $curview if {$mainheadid ne $viewmainheadid_orig($view)} { @@ -616,12 +641,16 @@ proc varcinit {view} { proc resetvarcs {view} { global varcid varccommits parents children vseedcount ordertok + global vshortids foreach vid [array names varcid $view,*] { unset varcid($vid) unset children($vid) unset parents($vid) } + foreach vid [array names vshortids $view,*] { + unset vshortids($vid) + } # some commits might have children but haven't been seen yet foreach vid [array names children $view,*] { unset children($vid) @@ -659,7 +688,7 @@ proc newvarc {view id} { if {![info exists commitinfo($id)]} { parsecommit $id $commitdata($id) 1 } - set cdate [lindex $commitinfo($id) 4] + set cdate [lindex [lindex $commitinfo($id) 4] 0] if {![string is integer -strict $cdate]} { set cdate 0 } @@ -908,7 +937,7 @@ proc fix_reversal {p a v} { proc insertrow {id p v} { global cmitlisted children parents varcid varctok vtokmod global varccommits ordertok commitidx numcommits curview - global targetid targetrow + global targetid targetrow vshortids readcommit $id set vid $v,$id @@ -917,6 +946,7 @@ proc insertrow {id p v} { set parents($vid) [list $p] set a [newvarc $v $id] set varcid($vid) $a + lappend vshortids($v,[string range $id 0 3]) $id if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] < 0} { modify_arc $v $a } @@ -1372,7 +1402,7 @@ proc getcommitlines {fd inst view updating} { global commitidx commitdata vdatemode global parents children curview hlview global idpending ordertok - global varccommits varcid varctok vtokmod vfilelimit + global varccommits varcid varctok vtokmod vfilelimit vshortids set stuff [read $fd 500000] # git log doesn't terminate the last commit with a null... @@ -1472,6 +1502,8 @@ proc getcommitlines {fd inst view updating} { set id [lindex $ids 0] set vid $view,$id + lappend vshortids($view,[string range $id 0 3]) $id + if {!$listed && $updating && ![info exists varcid($vid)] && $vfilelimit($view) ne {}} { # git log doesn't rewrite parents for unlisted commits @@ -1621,7 +1653,7 @@ proc readcommit {id} { } proc parsecommit {id contents listed} { - global commitinfo cdate + global commitinfo set inhdr 1 set comment {} @@ -1641,10 +1673,10 @@ proc parsecommit {id contents listed} { set line [split $line " "] set tag [lindex $line 0] if {$tag == "author"} { - set audate [lindex $line end-1] + set audate [lrange $line end-1 end] set auname [join [lrange $line 1 end-2] " "] } elseif {$tag == "committer"} { - set comdate [lindex $line end-1] + set comdate [lrange $line end-1 end] set comname [join [lrange $line 1 end-2] " "] } } @@ -1671,11 +1703,9 @@ proc parsecommit {id contents listed} { } set comment $newcomment } - if {$comdate != {}} { - set cdate($id) $comdate - } + set hasnote [string first "\nNotes:\n" $contents] set commitinfo($id) [list $headline $auname $audate \ - $comname $comdate $comment] + $comname $comdate $comment $hasnote] } proc getcommit {id} { @@ -1696,11 +1726,26 @@ proc getcommit {id} { # and are present in the current view. # This is fairly slow... proc longid {prefix} { - global varcid curview + global varcid curview vshortids set ids {} - foreach match [array names varcid "$curview,$prefix*"] { - lappend ids [lindex [split $match ","] 1] + if {[string length $prefix] >= 4} { + set vshortid $curview,[string range $prefix 0 3] + if {[info exists vshortids($vshortid)]} { + foreach id $vshortids($vshortid) { + if {[string match "$prefix*" $id]} { + if {[lsearch -exact $ids $id] < 0} { + lappend ids $id + if {[llength $ids] >= 2} break + } + } + } + } + } else { + foreach match [array names varcid "$curview,$prefix*"] { + lappend ids [lindex [split $match ","] 1] + if {[llength $ids] >= 2} break + } } return $ids } @@ -1993,7 +2038,7 @@ proc makewindow {} { set file { mc "File" cascade { {mc "Update" command updatecommits -accelerator F5} - {mc "Reload" command reloadcommits -accelerator Meta1-F5} + {mc "Reload" command reloadcommits -accelerator Shift-F5} {mc "Reread references" command rereadrefs} {mc "List references" command showrefs -accelerator F2} {xx "" separator} @@ -2116,7 +2161,7 @@ proc makewindow {} { trace add variable sha1string write sha1change pack $sha1entry -side left -pady 2 - image create bitmap bm-left -data { + set bm_left_data { #define left_width 16 #define left_height 16 static unsigned char left_bits[] = { @@ -2124,7 +2169,7 @@ proc makewindow {} { 0x0e, 0x00, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x0e, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0, 0x01}; } - image create bitmap bm-right -data { + set bm_right_data { #define right_width 16 #define right_height 16 static unsigned char right_bits[] = { @@ -2132,11 +2177,24 @@ proc makewindow {} { 0x00, 0x38, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01}; } - ${NS}::button .tf.bar.leftbut -image bm-left -command goback \ - -state disabled -width 26 + image create bitmap bm-left -data $bm_left_data + image create bitmap bm-left-gray -data $bm_left_data -foreground "#999" + image create bitmap bm-right -data $bm_right_data + image create bitmap bm-right-gray -data $bm_right_data -foreground "#999" + + ${NS}::button .tf.bar.leftbut -command goback -state disabled -width 26 + if {$use_ttk} { + .tf.bar.leftbut configure -image [list bm-left disabled bm-left-gray] + } else { + .tf.bar.leftbut configure -image bm-left + } pack .tf.bar.leftbut -side left -fill y - ${NS}::button .tf.bar.rightbut -image bm-right -command goforw \ - -state disabled -width 26 + ${NS}::button .tf.bar.rightbut -command goforw -state disabled -width 26 + if {$use_ttk} { + .tf.bar.rightbut configure -image [list bm-right disabled bm-right-gray] + } else { + .tf.bar.rightbut configure -image bm-right + } pack .tf.bar.rightbut -side left -fill y ${NS}::label .tf.bar.rowlabel -text [mc "Row"] @@ -2316,6 +2374,8 @@ proc makewindow {} { $ctext tag conf mresult -font textfontbold $ctext tag conf msep -font textfontbold $ctext tag conf found -back yellow + $ctext tag conf currentsearchhit -back orange + $ctext tag conf wwrap -wrap word .pwbottom add .bleft if {!$use_ttk} { @@ -2437,9 +2497,9 @@ proc makewindow {} { bindkey n "selnextline 1" bindkey z "goback" bindkey x "goforw" - bindkey i "selnextline -1" - bindkey k "selnextline 1" - bindkey j "goback" + bindkey k "selnextline -1" + bindkey j "selnextline 1" + bindkey h "goback" bindkey l "goforw" bindkey b prevfile bindkey d "$ctext yview scroll 18 units" @@ -2450,10 +2510,9 @@ proc makewindow {} { bindkey ? {dofind -1 1} bindkey f nextfile bind . <F5> updatecommits - bind . <$M1B-F5> reloadcommits + bindmodfunctionkey Shift 5 reloadcommits bind . <F2> showrefs - bind . <Shift-F4> {newview 0} - catch { bind . <Shift-Key-XF86_Switch_VT_4> {newview 0} } + bindmodfunctionkey Shift 4 {newview 0} bind . <F4> edit_or_newview bind . <$M1B-q> doquit bind . <$M1B-f> {dofind 1 1} @@ -2478,6 +2537,7 @@ proc makewindow {} { bind $cflist $ctxbut {pop_flist_menu %W %X %Y %x %y} bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y} bind $ctext <Button-1> {focus %W} + bind $ctext <<Selection>> rehighlight_search_results set maincursor [. cget -cursor] set textcursor [$ctext cget -cursor] @@ -2497,6 +2557,8 @@ proc makewindow {} { {mc "Return to mark" command gotomark} {mc "Find descendant of this and mark" command find_common_desc} {mc "Compare with marked commit" command compare_commits} + {mc "Diff this -> marked commit" command {diffvsmark 0}} + {mc "Diff marked commit -> this" command {diffvsmark 1}} } $rowctxmenu configure -tearoff 0 @@ -2505,6 +2567,8 @@ proc makewindow {} { {mc "Diff this -> selected" command {diffvssel 0}} {mc "Diff selected -> this" command {diffvssel 1}} {mc "Make patch" command mkpatch} + {mc "Diff this -> marked commit" command {diffvsmark 0}} + {mc "Diff marked commit -> this" command {diffvsmark 1}} } $fakerowmenu configure -tearoff 0 @@ -2597,6 +2661,11 @@ proc bindkey {ev script} { } } +proc bindmodfunctionkey {mod n script} { + bind . <$mod-F$n> $script + catch { bind . <$mod-XF86_Switch_VT_$n> $script } +} + # set the focus back to the toplevel for any click outside # the entry widgets proc click {w} { @@ -2653,7 +2722,7 @@ proc savestuff {w} { global cmitmode wrapcomment datetimeformat limitdiffs global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk - global hideremotes want_ttk + global hideremotes want_ttk maxrefs if {$stuffsaved} return if {![winfo viewable .]} return @@ -2675,6 +2744,7 @@ proc savestuff {w} { puts $f [list set autoselect $autoselect] puts $f [list set autosellen $autosellen] puts $f [list set showneartags $showneartags] + puts $f [list set maxrefs $maxrefs] puts $f [list set hideremotes $hideremotes] puts $f [list set showlocalchanges $showlocalchanges] puts $f [list set datetimeformat $datetimeformat] @@ -2815,7 +2885,7 @@ proc about {} { message $w.m -text [mc " Gitk - a commit viewer for git -Copyright \u00a9 2005-2010 Paul Mackerras +Copyright \u00a9 2005-2011 Paul Mackerras Use and redistribute under the terms of the GNU General Public License"] \ -justify center -aspect 400 -border 2 -bg white -relief groove @@ -2850,9 +2920,9 @@ proc keys {} { [mc "<%s-W> Close window" $M1T] [mc "<Home> Move to first commit"] [mc "<End> Move to last commit"] -[mc "<Up>, p, i Move up one commit"] -[mc "<Down>, n, k Move down one commit"] -[mc "<Left>, z, j Go back in history list"] +[mc "<Up>, p, k Move up one commit"] +[mc "<Down>, n, j Move down one commit"] +[mc "<Left>, z, h Go back in history list"] [mc "<Right>, x, l Go forward in history list"] [mc "<PageUp> Move up one page in commit list"] [mc "<PageDown> Move down one page in commit list"] @@ -3260,6 +3330,7 @@ proc sel_flist {w x y} { } else { catch {$ctext yview [lindex $difffilestart [expr {$l - 2}]]} } + suppress_highlighting_file_for_current_scrollpos } proc pop_flist_menu {w X Y x y} { @@ -3333,8 +3404,7 @@ proc gitknewtmpdir {} { global diffnum gitktmpdir gitdir if {![info exists gitktmpdir]} { - set gitktmpdir [file join [file dirname $gitdir] \ - [format ".gitk-tmp.%s" [pid]]] + set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]] if {[catch {file mkdir $gitktmpdir} err]} { error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err" unset gitktmpdir @@ -3366,10 +3436,10 @@ proc save_file_from_commit {filename output what} { proc external_diff_get_one_file {diffid filename diffdir} { global nullid nullid2 nullfile - global gitdir + global worktree if {$diffid == $nullid} { - set difffile [file join [file dirname $gitdir] $filename] + set difffile [file join $worktree $filename] if {[file exists $difffile]} { return $difffile } @@ -3559,7 +3629,7 @@ proc make_relative {f} { } proc external_blame {parent_idx {line {}}} { - global flist_menu_file gitdir + global flist_menu_file cdup global nullid nullid2 global parentlist selectedline currentid @@ -3578,7 +3648,7 @@ proc external_blame {parent_idx {line {}}} { if {$line ne {} && $line > 1} { lappend cmdline "--line=$line" } - set f [file join [file dirname $gitdir] $flist_menu_file] + set f [file join $cdup $flist_menu_file] # Unfortunately it seems git gui blame doesn't like # being given an absolute path... set f [make_relative $f] @@ -3591,7 +3661,7 @@ proc external_blame {parent_idx {line {}}} { proc show_line_source {} { global cmitmode currentid parents curview blamestuff blameinst global diff_menu_line diff_menu_filebase flist_menu_file - global nullid nullid2 gitdir + global nullid nullid2 gitdir cdup set from_index {} if {$cmitmode eq "tree"} { @@ -3644,7 +3714,7 @@ proc show_line_source {} { } else { lappend blameargs $id } - lappend blameargs -- [file join [file dirname $gitdir] $flist_menu_file] + lappend blameargs -- [file join $cdup $flist_menu_file] if {[catch { set f [open $blameargs r] } err]} { @@ -4529,12 +4599,22 @@ proc makepatterns {l} { proc do_file_hl {serial} { global highlight_files filehighlight highlight_paths gdttype fhl_list + global cdup findtype if {$gdttype eq [mc "touching paths:"]} { + # If "exact" match then convert backslashes to forward slashes. + # Most useful to support Windows-flavoured file paths. + if {$findtype eq [mc "Exact"]} { + set highlight_files [string map {"\\" "/"} $highlight_files] + } if {[catch {set paths [shellsplit $highlight_files]}]} return set highlight_paths [makepatterns $paths] highlight_filelist - set gdtargs [concat -- $paths] + set relative_paths {} + foreach path $paths { + lappend relative_paths [file join $cdup $path] + } + set gdtargs [concat -- $relative_paths] } elseif {$gdttype eq [mc "adding/removing string:"]} { set gdtargs [list "-S$highlight_files"] } else { @@ -4627,8 +4707,9 @@ proc askfindhighlight {row id} { } set info $commitinfo($id) set isbold 0 - set fldtypes [list [mc Headline] [mc Author] [mc Date] [mc Committer] [mc CDate] [mc Comments]] + set fldtypes [list [mc Headline] [mc Author] "" [mc Committer] "" [mc Comments]] foreach f $info ty $fldtypes { + if {$ty eq ""} continue if {($findloc eq [mc "All fields"] || $findloc eq $ty) && [doesmatch $f]} { if {$ty eq [mc "Author"]} { @@ -5031,9 +5112,9 @@ proc dohidelocalchanges {} { # spawn off a process to do git diff-index --cached HEAD proc dodiffindex {} { global lserial showlocalchanges vfilelimit curview - global isworktree + global hasworktree - if {!$showlocalchanges || !$isworktree} return + if {!$showlocalchanges || !$hasworktree} return incr lserial set cmd "|git diff-index --cached HEAD" if {$vfilelimit($curview) ne {}} { @@ -5899,6 +5980,9 @@ proc drawcmittext {id row col} { || [info exists idotherrefs($id)]} { set xt [drawtags $id $x $xt $y] } + if {[lindex $commitinfo($id) 6] > 0} { + set xt [drawnotesign $xt $y] + } set headline [lindex $commitinfo($id) 0] set name [lindex $commitinfo($id) 1] set date [lindex $commitinfo($id) 2] @@ -6345,6 +6429,17 @@ proc drawtags {id x xt y1} { return $xt } +proc drawnotesign {xt y} { + global linespc canv fgcolor + + set orad [expr {$linespc / 3}] + set t [$canv create rectangle [expr {$xt - $orad}] [expr {$y - $orad}] \ + [expr {$xt + $orad - 1}] [expr {$y + $orad - 1}] \ + -fill yellow -outline $fgcolor -width 1 -tags circle] + set xt [expr {$xt + $orad * 3}] + return $xt +} + proc xcoord {i level ln} { global canvx0 xspc1 xspc2 @@ -6475,7 +6570,7 @@ proc findmore {} { if {![info exists find_dirn]} { return 0 } - set fldtypes [list [mc "Headline"] [mc "Author"] [mc "Date"] [mc "Committer"] [mc "CDate"] [mc "Comments"]] + set fldtypes [list [mc "Headline"] [mc "Author"] "" [mc "Committer"] "" [mc "Comments"]] set l $findcurline set moretodo 0 if {$find_dirn > 0} { @@ -6536,6 +6631,7 @@ proc findmore {} { } set info $commitinfo($id) foreach f $info ty $fldtypes { + if {$ty eq ""} continue if {($findloc eq [mc "All fields"] || $findloc eq $ty) && [doesmatch $f]} { set found 1 @@ -6688,7 +6784,7 @@ proc appendwithlinks {text tags} { set start [$ctext index "end - 1c"] $ctext insert end $text $tags - set links [regexp -indices -all -inline {\m[0-9a-f]{6,40}\M} $text] + set links [regexp -indices -all -inline {(?:\m|-g)[0-9a-f]{6,40}\M} $text] foreach l $links { set s [lindex $l 0] set e [lindex $l 1] @@ -6704,6 +6800,10 @@ proc appendwithlinks {text tags} { proc setlink {id lk} { global curview ctext pendinglinks + if {[string range $id 0 1] eq "-g"} { + set id [string range $id 2 end] + } + set known 0 if {[string length $id] < 40} { set matches [longid $id] @@ -6779,7 +6879,7 @@ proc viewnextline {dir} { # add a list of tag or branch names at position pos # returns the number of names inserted proc appendrefs {pos ids var} { - global ctext linknum curview $var maxrefs + global ctext linknum curview $var maxrefs mainheadid if {[catch {$ctext index $pos}]} { return 0 @@ -6792,24 +6892,54 @@ proc appendrefs {pos ids var} { lappend tags [list $tag $id] } } + + set sep {} + set tags [lsort -index 0 -decreasing $tags] + set nutags 0 + if {[llength $tags] > $maxrefs} { - $ctext insert $pos "[mc "many"] ([llength $tags])" - } else { - set tags [lsort -index 0 -decreasing $tags] - set sep {} - foreach ti $tags { - set id [lindex $ti 1] - set lk link$linknum - incr linknum - $ctext tag delete $lk - $ctext insert $pos $sep - $ctext insert $pos [lindex $ti 0] $lk - setlink $id $lk - set sep ", " + # If we are displaying heads, and there are too many, + # see if there are some important heads to display. + # Currently this means "master" and the current head. + set itags {} + if {$var eq "idheads"} { + set utags {} + foreach ti $tags { + set hname [lindex $ti 0] + set id [lindex $ti 1] + if {($hname eq "master" || $id eq $mainheadid) && + [llength $itags] < $maxrefs} { + lappend itags $ti + } else { + lappend utags $ti + } + } + set tags $utags + } + if {$itags ne {}} { + set str [mc "and many more"] + set sep " " + } else { + set str [mc "many"] } + $ctext insert $pos "$str ([llength $tags])" + set nutags [llength $tags] + set tags $itags } + + foreach ti $tags { + set id [lindex $ti 1] + set lk link$linknum + incr linknum + $ctext tag delete $lk + $ctext insert $pos $sep + $ctext insert $pos [lindex $ti 0] $lk + setlink $id $lk + set sep ", " + } + $ctext tag add wwrap "$pos linestart" "$pos lineend" $ctext conf -state disabled - return [llength $tags] + return [expr {[llength $tags] + $nutags}] } # called when we have finished computing the nearby tags @@ -7376,19 +7506,15 @@ proc startdiff {ids} { } } +# If the filename (name) is under any of the passed filter paths +# then return true to include the file in the listing. proc path_filter {filter name} { + set worktree [gitworktree] foreach p $filter { - set l [string length $p] - if {[string index $p end] eq "/"} { - if {[string compare -length $l $p $name] == 0} { - return 1 - } - } else { - if {[string compare -length $l $p $name] == 0 && - ([string length $name] == $l || - [string index $name $l] eq "/")} { - return 1 - } + set fq_p [file normalize $p] + set fq_n [file normalize [file join $worktree $name]] + if {[string match [file normalize $fq_p]* $fq_n]} { + return 1 } } return 0 @@ -7402,7 +7528,7 @@ proc addtocflist {ids} { } proc diffcmd {ids flags} { - global nullid nullid2 + global log_showroot nullid nullid2 set i [lsearch -exact $ids $nullid] set j [lsearch -exact $ids $nullid2] @@ -7436,6 +7562,9 @@ proc diffcmd {ids flags} { lappend cmd HEAD } } else { + if {$log_showroot} { + lappend flags --root + } set cmd [concat | git diff-tree -r $flags $ids] } return $cmd @@ -7870,32 +7999,45 @@ proc changediffdisp {} { $ctext tag conf dresult -elide [lindex $diffelide 1] } -proc highlightfile {loc cline} { - global ctext cflist cflist_top +proc highlightfile {cline} { + global cflist cflist_top + + if {![info exists cflist_top]} return - $ctext yview $loc $cflist tag remove highlight $cflist_top.0 "$cflist_top.0 lineend" $cflist tag add highlight $cline.0 "$cline.0 lineend" $cflist see $cline.0 set cflist_top $cline } +proc highlightfile_for_scrollpos {topidx} { + global cmitmode difffilestart + + if {$cmitmode eq "tree"} return + if {![info exists difffilestart]} return + + set top [lindex [split $topidx .] 0] + if {$difffilestart eq {} || $top < [lindex $difffilestart 0]} { + highlightfile 0 + } else { + highlightfile [expr {[bsearch $difffilestart $top] + 2}] + } +} + proc prevfile {} { global difffilestart ctext cmitmode if {$cmitmode eq "tree"} return set prev 0.0 - set prevline 1 set here [$ctext index @0,0] foreach loc $difffilestart { if {[$ctext compare $loc >= $here]} { - highlightfile $prev $prevline + $ctext yview $prev return } set prev $loc - incr prevline } - highlightfile $prev $prevline + $ctext yview $prev } proc nextfile {} { @@ -7903,11 +8045,9 @@ proc nextfile {} { if {$cmitmode eq "tree"} return set here [$ctext index @0,0] - set line 1 foreach loc $difffilestart { - incr line if {[$ctext compare $loc > $here]} { - highlightfile $loc $line + $ctext yview $loc return } } @@ -7953,7 +8093,6 @@ proc settabs {{firstab {}}} { proc incrsearch {name ix op} { global ctext searchstring searchdirn - $ctext tag remove found 1.0 end if {[catch {$ctext index anchor}]} { # no anchor set, use start of selection, or of visible area set sel [$ctext tag ranges sel] @@ -7966,12 +8105,17 @@ proc incrsearch {name ix op} { } } if {$searchstring ne {}} { - set here [$ctext search $searchdirn -- $searchstring anchor] + set here [$ctext search -count mlen $searchdirn -- $searchstring anchor] if {$here ne {}} { $ctext see $here + set mend "$here + $mlen c" + $ctext tag remove sel 1.0 end + $ctext tag add sel $here $mend + suppress_highlighting_file_for_current_scrollpos + highlightfile_for_scrollpos $here } - searchmarkvisible 1 } + rehighlight_search_results } proc dosearch {} { @@ -7994,9 +8138,12 @@ proc dosearch {} { return } $ctext see $match + suppress_highlighting_file_for_current_scrollpos + highlightfile_for_scrollpos $match set mend "$match + $mlen c" $ctext tag add sel $match $mend $ctext mark unset anchor + rehighlight_search_results } } @@ -8020,21 +8167,41 @@ proc dosearchback {} { return } $ctext see $match + suppress_highlighting_file_for_current_scrollpos + highlightfile_for_scrollpos $match set mend "$match + $ml c" $ctext tag add sel $match $mend $ctext mark unset anchor + rehighlight_search_results + } +} + +proc rehighlight_search_results {} { + global ctext searchstring + + $ctext tag remove found 1.0 end + $ctext tag remove currentsearchhit 1.0 end + + if {$searchstring ne {}} { + searchmarkvisible 1 } } proc searchmark {first last} { global ctext searchstring + set sel [$ctext tag ranges sel] + set mend $first.0 while {1} { set match [$ctext search -count mlen -- $searchstring $mend $last.end] if {$match eq {}} break set mend "$match + $mlen c" - $ctext tag add found $match $mend + if {$sel ne {} && [$ctext compare $match == [lindex $sel 0]]} { + $ctext tag add currentsearchhit $match $mend + } else { + $ctext tag add found $match $mend + } } } @@ -8060,8 +8227,23 @@ proc searchmarkvisible {doall} { } } +proc suppress_highlighting_file_for_current_scrollpos {} { + global ctext suppress_highlighting_file_for_this_scrollpos + + set suppress_highlighting_file_for_this_scrollpos [$ctext index @0,0] +} + proc scrolltext {f0 f1} { - global searchstring + global searchstring cmitmode ctext + global suppress_highlighting_file_for_this_scrollpos + + set topidx [$ctext index @0,0] + if {![info exists suppress_highlighting_file_for_this_scrollpos] + || $topidx ne $suppress_highlighting_file_for_this_scrollpos} { + highlightfile_for_scrollpos $topidx + } + + catch {unset suppress_highlighting_file_for_this_scrollpos} .bleft.bottom.sb set $f0 $f1 if {$searchstring ne {}} { @@ -8425,6 +8607,11 @@ proc rowmenu {x y id} { } else { set state normal } + if {[info exists markedid] && $markedid ne $id} { + set mstate normal + } else { + set mstate disabled + } if {$id ne $nullid && $id ne $nullid2} { set menu $rowctxmenu if {$mainhead ne {}} { @@ -8432,21 +8619,17 @@ proc rowmenu {x y id} { } else { $menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled } - if {[info exists markedid] && $markedid ne $id} { - $menu entryconfigure 9 -state normal - $menu entryconfigure 10 -state normal - $menu entryconfigure 11 -state normal - } else { - $menu entryconfigure 9 -state disabled - $menu entryconfigure 10 -state disabled - $menu entryconfigure 11 -state disabled - } + $menu entryconfigure 9 -state $mstate + $menu entryconfigure 10 -state $mstate + $menu entryconfigure 11 -state $mstate } else { set menu $fakerowmenu } $menu entryconfigure [mca "Diff this -> selected"] -state $state $menu entryconfigure [mca "Diff selected -> this"] -state $state $menu entryconfigure [mca "Make patch"] -state $state + $menu entryconfigure [mca "Diff this -> marked commit"] -state $mstate + $menu entryconfigure [mca "Diff marked commit -> this"] -state $mstate tk_popup $menu $x $y } @@ -8650,6 +8833,21 @@ proc diffvssel {dirn} { doseldiff $oldid $newid } +proc diffvsmark {dirn} { + global rowmenuid markedid + + if {![info exists markedid]} return + if {$dirn} { + set oldid $markedid + set newid $rowmenuid + } else { + set oldid $rowmenuid + set newid $markedid + } + addtohistory [list doseldiff $oldid $newid] savectextpos + doseldiff $oldid $newid +} + proc doseldiff {oldid newid} { global ctext global commitinfo @@ -9043,6 +9241,7 @@ proc exec_citool {tool_args {baseid {}}} { proc cherrypick {} { global rowmenuid curview global mainhead mainheadid + global gitdir set oldhead [exec git rev-parse HEAD] set dheads [descheads $rowmenuid] @@ -9071,7 +9270,7 @@ proc cherrypick {} { conflict.\nDo you wish to run git citool to\ resolve it?"]]} { # Force citool to read MERGE_MSG - file delete [file join [gitdir] "GITGUI_MSG"] + file delete [file join $gitdir "GITGUI_MSG"] exec_citool {} $rowmenuid } } else { @@ -9437,6 +9636,7 @@ proc refill_reflist {} { proc getallcommits {} { global allcommits nextarc seeds allccache allcwait cachedarcs allcupdate global idheads idtags idotherrefs allparents tagobjid + global gitdir if {![info exists allcommits]} { set nextarc 0 @@ -9444,7 +9644,7 @@ proc getallcommits {} { set seeds {} set allcwait 0 set cachedarcs 0 - set allccache [file join [gitdir] "gitk.cache"] + set allccache [file join $gitdir "gitk.cache"] if {![catch { set f [open $allccache r] set allcwait 1 @@ -10414,13 +10614,13 @@ proc anctags {id} { # including id itself if it has a head. proc descheads {id} { global arcnos arcstart arcids archeads idheads cached_dheads - global allparents + global allparents arcout if {![info exists allparents($id)]} { return {} } set aret {} - if {[llength $arcnos($id)] == 1 && [llength $allparents($id)] == 1} { + if {![info exists arcout($id)]} { # part-way along an arc; check it first set a [lindex $arcnos($id) 0] if {$archeads($a) ne {}} { @@ -10504,7 +10704,7 @@ proc movedhead {hid head} { } proc changedrefs {} { - global cached_dheads cached_dtags cached_atags + global cached_dheads cached_dtags cached_atags cached_tagcontent global arctags archeads arcnos arcout idheads idtags foreach id [concat [array names idheads] [array names idtags]] { @@ -10516,6 +10716,7 @@ proc changedrefs {} { } } } + catch {unset cached_tagcontent} catch {unset cached_dtags} catch {unset cached_atags} catch {unset cached_dheads} @@ -10568,7 +10769,7 @@ proc listrefs {id} { } proc showtag {tag isnew} { - global ctext tagcontents tagids linknum tagobjid + global ctext cached_tagcontent tagids linknum tagobjid if {$isnew} { addtohistory [list showtag $tag 0] savectextpos @@ -10577,13 +10778,13 @@ proc showtag {tag isnew} { clear_ctext settabs 0 set linknum 0 - if {![info exists tagcontents($tag)]} { + if {![info exists cached_tagcontent($tag)]} { catch { - set tagcontents($tag) [exec git cat-file tag $tag] + set cached_tagcontent($tag) [exec git cat-file tag $tag] } } - if {[info exists tagcontents($tag)]} { - set text $tagcontents($tag) + if {[info exists cached_tagcontent($tag)]} { + set text $cached_tagcontent($tag) } else { set text "[mc "Tag"]: $tag\n[mc "Id"]: $tagids($tag)" } @@ -10700,7 +10901,7 @@ proc fontok {} { if {$fontparam(slant) eq "italic"} { lappend fontpref($f) "italic" } - set w $prefstop.$f + set w $prefstop.notebook.fonts.$f $w conf -text $fontparam(family) -font $fontpref($f) fontcan @@ -10754,6 +10955,142 @@ proc chg_fontparam {v sub op} { font config sample -$sub $fontparam($sub) } +# Create a property sheet tab page +proc create_prefs_page {w} { + global NS + set parent [join [lrange [split $w .] 0 end-1] .] + if {[winfo class $parent] eq "TNotebook"} { + ${NS}::frame $w + } else { + ${NS}::labelframe $w + } +} + +proc prefspage_general {notebook} { + global NS maxwidth maxgraphpct showneartags showlocalchanges + global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs + global hideremotes want_ttk have_ttk maxrefs + + set page [create_prefs_page $notebook.general] + + ${NS}::label $page.ldisp -text [mc "Commit list display options"] + grid $page.ldisp - -sticky w -pady 10 + ${NS}::label $page.spacer -text " " + ${NS}::label $page.maxwidthl -text [mc "Maximum graph width (lines)"] + spinbox $page.maxwidth -from 0 -to 100 -width 4 -textvariable maxwidth + grid $page.spacer $page.maxwidthl $page.maxwidth -sticky w + ${NS}::label $page.maxpctl -text [mc "Maximum graph width (% of pane)"] + spinbox $page.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct + grid x $page.maxpctl $page.maxpct -sticky w + ${NS}::checkbutton $page.showlocal -text [mc "Show local changes"] \ + -variable showlocalchanges + grid x $page.showlocal -sticky w + ${NS}::checkbutton $page.autoselect -text [mc "Auto-select SHA1 (length)"] \ + -variable autoselect + spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen + grid x $page.autoselect $page.autosellen -sticky w + ${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \ + -variable hideremotes + grid x $page.hideremotes -sticky w + + ${NS}::label $page.ddisp -text [mc "Diff display options"] + grid $page.ddisp - -sticky w -pady 10 + ${NS}::label $page.tabstopl -text [mc "Tab spacing"] + spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop + grid x $page.tabstopl $page.tabstop -sticky w + ${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \ + -variable showneartags + grid x $page.ntag -sticky w + ${NS}::label $page.maxrefsl -text [mc "Maximum # tags/heads to show"] + spinbox $page.maxrefs -from 1 -to 1000 -width 4 -textvariable maxrefs + grid x $page.maxrefsl $page.maxrefs -sticky w + ${NS}::checkbutton $page.ldiff -text [mc "Limit diffs to listed paths"] \ + -variable limitdiffs + grid x $page.ldiff -sticky w + ${NS}::checkbutton $page.lattr -text [mc "Support per-file encodings"] \ + -variable perfile_attrs + grid x $page.lattr -sticky w + + ${NS}::entry $page.extdifft -textvariable extdifftool + ${NS}::frame $page.extdifff + ${NS}::label $page.extdifff.l -text [mc "External diff tool" ] + ${NS}::button $page.extdifff.b -text [mc "Choose..."] -command choose_extdiff + pack $page.extdifff.l $page.extdifff.b -side left + pack configure $page.extdifff.l -padx 10 + grid x $page.extdifff $page.extdifft -sticky ew + + ${NS}::label $page.lgen -text [mc "General options"] + grid $page.lgen - -sticky w -pady 10 + ${NS}::checkbutton $page.want_ttk -variable want_ttk \ + -text [mc "Use themed widgets"] + if {$have_ttk} { + ${NS}::label $page.ttk_note -text [mc "(change requires restart)"] + } else { + ${NS}::label $page.ttk_note -text [mc "(currently unavailable)"] + } + grid x $page.want_ttk $page.ttk_note -sticky w + return $page +} + +proc prefspage_colors {notebook} { + global NS uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor + + set page [create_prefs_page $notebook.colors] + + ${NS}::label $page.cdisp -text [mc "Colors: press to choose"] + grid $page.cdisp - -sticky w -pady 10 + label $page.ui -padx 40 -relief sunk -background $uicolor + ${NS}::button $page.uibut -text [mc "Interface"] \ + -command [list choosecolor uicolor {} $page.ui [mc "interface"] setui] + grid x $page.uibut $page.ui -sticky w + label $page.bg -padx 40 -relief sunk -background $bgcolor + ${NS}::button $page.bgbut -text [mc "Background"] \ + -command [list choosecolor bgcolor {} $page.bg [mc "background"] setbg] + grid x $page.bgbut $page.bg -sticky w + label $page.fg -padx 40 -relief sunk -background $fgcolor + ${NS}::button $page.fgbut -text [mc "Foreground"] \ + -command [list choosecolor fgcolor {} $page.fg [mc "foreground"] setfg] + grid x $page.fgbut $page.fg -sticky w + label $page.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0] + ${NS}::button $page.diffoldbut -text [mc "Diff: old lines"] \ + -command [list choosecolor diffcolors 0 $page.diffold [mc "diff old lines"] \ + [list $ctext tag conf d0 -foreground]] + grid x $page.diffoldbut $page.diffold -sticky w + label $page.diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1] + ${NS}::button $page.diffnewbut -text [mc "Diff: new lines"] \ + -command [list choosecolor diffcolors 1 $page.diffnew [mc "diff new lines"] \ + [list $ctext tag conf dresult -foreground]] + grid x $page.diffnewbut $page.diffnew -sticky w + label $page.hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2] + ${NS}::button $page.hunksepbut -text [mc "Diff: hunk header"] \ + -command [list choosecolor diffcolors 2 $page.hunksep \ + [mc "diff hunk header"] \ + [list $ctext tag conf hunksep -foreground]] + grid x $page.hunksepbut $page.hunksep -sticky w + label $page.markbgsep -padx 40 -relief sunk -background $markbgcolor + ${NS}::button $page.markbgbut -text [mc "Marked line bg"] \ + -command [list choosecolor markbgcolor {} $page.markbgsep \ + [mc "marked line background"] \ + [list $ctext tag conf omark -background]] + grid x $page.markbgbut $page.markbgsep -sticky w + label $page.selbgsep -padx 40 -relief sunk -background $selectbgcolor + ${NS}::button $page.selbgbut -text [mc "Select bg"] \ + -command [list choosecolor selectbgcolor {} $page.selbgsep [mc "background"] setselbg] + grid x $page.selbgbut $page.selbgsep -sticky w + return $page +} + +proc prefspage_fonts {notebook} { + global NS + set page [create_prefs_page $notebook.fonts] + ${NS}::label $page.cfont -text [mc "Fonts: press to choose"] + grid $page.cfont - -sticky w -pady 10 + mkfontdisp mainfont $page [mc "Main font"] + mkfontdisp textfont $page [mc "Diff display font"] + mkfontdisp uifont $page [mc "User interface font"] + return $page +} + proc doprefs {} { global maxwidth maxgraphpct use_ttk NS global oldprefs prefstop showneartags showlocalchanges @@ -10774,106 +11111,38 @@ proc doprefs {} { ttk_toplevel $top wm title $top [mc "Gitk preferences"] make_transient $top . - ${NS}::label $top.ldisp -text [mc "Commit list display options"] - grid $top.ldisp - -sticky w -pady 10 - ${NS}::label $top.spacer -text " " - ${NS}::label $top.maxwidthl -text [mc "Maximum graph width (lines)"] - spinbox $top.maxwidth -from 0 -to 100 -width 4 -textvariable maxwidth - grid $top.spacer $top.maxwidthl $top.maxwidth -sticky w - ${NS}::label $top.maxpctl -text [mc "Maximum graph width (% of pane)"] - spinbox $top.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct - grid x $top.maxpctl $top.maxpct -sticky w - ${NS}::checkbutton $top.showlocal -text [mc "Show local changes"] \ - -variable showlocalchanges - grid x $top.showlocal -sticky w - ${NS}::checkbutton $top.autoselect -text [mc "Auto-select SHA1 (length)"] \ - -variable autoselect - spinbox $top.autosellen -from 1 -to 40 -width 4 -textvariable autosellen - grid x $top.autoselect $top.autosellen -sticky w - ${NS}::checkbutton $top.hideremotes -text [mc "Hide remote refs"] \ - -variable hideremotes - grid x $top.hideremotes -sticky w - - ${NS}::label $top.ddisp -text [mc "Diff display options"] - grid $top.ddisp - -sticky w -pady 10 - ${NS}::label $top.tabstopl -text [mc "Tab spacing"] - spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop - grid x $top.tabstopl $top.tabstop -sticky w - ${NS}::checkbutton $top.ntag -text [mc "Display nearby tags"] \ - -variable showneartags - grid x $top.ntag -sticky w - ${NS}::checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \ - -variable limitdiffs - grid x $top.ldiff -sticky w - ${NS}::checkbutton $top.lattr -text [mc "Support per-file encodings"] \ - -variable perfile_attrs - grid x $top.lattr -sticky w - - ${NS}::entry $top.extdifft -textvariable extdifftool - ${NS}::frame $top.extdifff - ${NS}::label $top.extdifff.l -text [mc "External diff tool" ] - ${NS}::button $top.extdifff.b -text [mc "Choose..."] -command choose_extdiff - pack $top.extdifff.l $top.extdifff.b -side left - pack configure $top.extdifff.l -padx 10 - grid x $top.extdifff $top.extdifft -sticky ew - - ${NS}::label $top.lgen -text [mc "General options"] - grid $top.lgen - -sticky w -pady 10 - ${NS}::checkbutton $top.want_ttk -variable want_ttk \ - -text [mc "Use themed widgets"] - if {$have_ttk} { - ${NS}::label $top.ttk_note -text [mc "(change requires restart)"] + + if {[set use_notebook [expr {$use_ttk && [info command ::ttk::notebook] ne ""}]]} { + set notebook [ttk::notebook $top.notebook] } else { - ${NS}::label $top.ttk_note -text [mc "(currently unavailable)"] - } - grid x $top.want_ttk $top.ttk_note -sticky w - - ${NS}::label $top.cdisp -text [mc "Colors: press to choose"] - grid $top.cdisp - -sticky w -pady 10 - label $top.ui -padx 40 -relief sunk -background $uicolor - ${NS}::button $top.uibut -text [mc "Interface"] \ - -command [list choosecolor uicolor {} $top.ui [mc "interface"] setui] - grid x $top.uibut $top.ui -sticky w - label $top.bg -padx 40 -relief sunk -background $bgcolor - ${NS}::button $top.bgbut -text [mc "Background"] \ - -command [list choosecolor bgcolor {} $top.bg [mc "background"] setbg] - grid x $top.bgbut $top.bg -sticky w - label $top.fg -padx 40 -relief sunk -background $fgcolor - ${NS}::button $top.fgbut -text [mc "Foreground"] \ - -command [list choosecolor fgcolor {} $top.fg [mc "foreground"] setfg] - grid x $top.fgbut $top.fg -sticky w - label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0] - ${NS}::button $top.diffoldbut -text [mc "Diff: old lines"] \ - -command [list choosecolor diffcolors 0 $top.diffold [mc "diff old lines"] \ - [list $ctext tag conf d0 -foreground]] - grid x $top.diffoldbut $top.diffold -sticky w - label $top.diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1] - ${NS}::button $top.diffnewbut -text [mc "Diff: new lines"] \ - -command [list choosecolor diffcolors 1 $top.diffnew [mc "diff new lines"] \ - [list $ctext tag conf dresult -foreground]] - grid x $top.diffnewbut $top.diffnew -sticky w - label $top.hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2] - ${NS}::button $top.hunksepbut -text [mc "Diff: hunk header"] \ - -command [list choosecolor diffcolors 2 $top.hunksep \ - [mc "diff hunk header"] \ - [list $ctext tag conf hunksep -foreground]] - grid x $top.hunksepbut $top.hunksep -sticky w - label $top.markbgsep -padx 40 -relief sunk -background $markbgcolor - ${NS}::button $top.markbgbut -text [mc "Marked line bg"] \ - -command [list choosecolor markbgcolor {} $top.markbgsep \ - [mc "marked line background"] \ - [list $ctext tag conf omark -background]] - grid x $top.markbgbut $top.markbgsep -sticky w - label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor - ${NS}::button $top.selbgbut -text [mc "Select bg"] \ - -command [list choosecolor selectbgcolor {} $top.selbgsep [mc "background"] setselbg] - grid x $top.selbgbut $top.selbgsep -sticky w - - ${NS}::label $top.cfont -text [mc "Fonts: press to choose"] - grid $top.cfont - -sticky w -pady 10 - mkfontdisp mainfont $top [mc "Main font"] - mkfontdisp textfont $top [mc "Diff display font"] - mkfontdisp uifont $top [mc "User interface font"] + set notebook [${NS}::frame $top.notebook -borderwidth 0 -relief flat] + } + + lappend pages [prefspage_general $notebook] [mc "General"] + lappend pages [prefspage_colors $notebook] [mc "Colors"] + lappend pages [prefspage_fonts $notebook] [mc "Fonts"] + set col 0 + foreach {page title} $pages { + if {$use_notebook} { + $notebook add $page -text $title + } else { + set btn [${NS}::button $notebook.b_[string map {. X} $page] \ + -text $title -command [list raise $page]] + $page configure -text $title + grid $btn -row 0 -column [incr col] -sticky w + grid $page -row 1 -column 0 -sticky news -columnspan 100 + } + } + + if {!$use_notebook} { + grid columnconfigure $notebook 0 -weight 1 + grid rowconfigure $notebook 1 -weight 1 + raise [lindex $pages 0] + } + + grid $notebook -sticky news -padx 2 -pady 2 + grid rowconfigure $top 0 -weight 1 + grid columnconfigure $top 0 -weight 1 ${NS}::frame $top.buts ${NS}::button $top.buts.ok -text [mc "OK"] -command prefsok -default active @@ -10885,7 +11154,7 @@ proc doprefs {} { grid columnconfigure $top.buts 1 -weight 1 -uniform a grid $top.buts - - -pady 10 -sticky ew grid columnconfigure $top 2 -weight 1 - bind $top <Visibility> "focus $top.buts.ok" + bind $top <Visibility> [list focus $top.buts.ok] } proc choose_extdiff {} { @@ -11024,7 +11293,7 @@ proc prefsok {} { proc formatdate {d} { global datetimeformat if {$d ne {}} { - set d [clock format $d -format $datetimeformat] + set d [clock format [lindex $d 0] -format $datetimeformat] } return $d } @@ -11372,6 +11641,11 @@ if {[catch {package require Tk 8.4} err]} { exit 1 } +# Unset GIT_TRACE var if set +if { [info exists ::env(GIT_TRACE)] } { + unset ::env(GIT_TRACE) +} + # defaults... set wrcomcmd "git diff-tree --stdin -p --pretty" @@ -11403,10 +11677,20 @@ catch { } } +set log_showroot true +catch { + set log_showroot [exec git config --bool --get log.showroot] +} + if {[tk windowingsystem] eq "aqua"} { set mainfont {{Lucida Grande} 9} set textfont {Monaco 9} set uifont {{Lucida Grande} 9 bold} +} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq "xft"} { + # fontconfig! + set mainfont {sans 9} + set textfont {monospace 9} + set uifont {sans 9 bold} } else { set mainfont {Helvetica 9} set textfont {Courier 9} @@ -11505,14 +11789,10 @@ setui $uicolor setoptions # check that we can find a .git directory somewhere... -if {[catch {set gitdir [gitdir]}]} { +if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { show_error {} . [mc "Cannot find a git repository here."] exit 1 } -if {![file isdirectory $gitdir]} { - show_error {} . [mc "Cannot find the git directory \"%s\"." $gitdir] - exit 1 -} set selecthead {} set selectheadid {} @@ -11592,6 +11872,8 @@ if {[package vcompare $git_version "1.6.6.2"] >= 0} { set show_notes "--show-notes" } +set appname "gitk" + set runq {} set history {} set historyindex 0 @@ -11628,7 +11910,12 @@ set stopped 0 set stuffsaved 0 set patchnum 0 set lserial 0 -set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}] +set hasworktree [hasworktree] +set cdup {} +if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} { + set cdup [exec git rev-parse --show-cdup] +} +set worktree [exec git rev-parse --show-toplevel] setcoords makewindow catch { @@ -11656,7 +11943,7 @@ catch { } # wait for the window to become visible tkwait visibility . -wm title . "[file tail $argv0]: [file tail [pwd]]" +wm title . "$appname: [reponame]" update readrefs diff --git a/gitk-git/po/sv.po b/gitk-git/po/sv.po index 2f07a2e2d9..8cc98dc079 100644 --- a/gitk-git/po/sv.po +++ b/gitk-git/po/sv.po @@ -1,40 +1,50 @@ # Swedish translation for gitk -# Copyright (C) 2005-2010 Paul Mackerras +# Copyright (C) 2005-2012 Paul Mackerras # This file is distributed under the same license as the gitk package. # -# Peter Krefting <peter@softwolves.pp.se>, 2008-2010. # Mikael Magnusson <mikachu@gmail.com>, 2008. +# Peter Krefting <peter@softwolves.pp.se>, 2008, 2009, 2010, 2012. +# msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-09-12 21:14+0100\n" -"PO-Revision-Date: 2010-09-12 21:16+0100\n" +"POT-Creation-Date: 2012-10-03 08:09+0100\n" +"PO-Revision-Date: 2012-10-03 08:13+0100\n" "Last-Translator: Peter Krefting <peter@softwolves.pp.se>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" +"Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit" +"Content-Transfer-Encoding: 8bit\n" -#: gitk:115 +#: gitk:140 msgid "Couldn't get list of unmerged files:" msgstr "Kunde inte hämta lista över ej sammanslagna filer:" -#: gitk:274 +#: gitk:210 gitk:2317 +msgid "Color words" +msgstr "Färga ord" + +#: gitk:215 gitk:2317 gitk:7888 gitk:7921 +msgid "Markup words" +msgstr "Märk upp ord" + +#: gitk:312 msgid "Error parsing revisions:" msgstr "Fel vid tolkning av revisioner:" -#: gitk:330 +#: gitk:368 msgid "Error executing --argscmd command:" msgstr "Fel vid körning av --argscmd-kommando:" -#: gitk:343 +#: gitk:381 msgid "No files selected: --merge specified but no files are unmerged." msgstr "" "Inga filer valdes: --merge angavs men det finns inga filer som inte har " "slagits samman." -#: gitk:346 +#: gitk:384 msgid "" "No files selected: --merge specified but no unmerged files are within file " "limit." @@ -42,605 +52,617 @@ msgstr "" "Inga filer valdes: --merge angavs men det finns inga filer inom " "filbegränsningen." -#: gitk:368 gitk:516 +#: gitk:406 gitk:554 msgid "Error executing git log:" msgstr "Fel vid körning av git log:" -#: gitk:386 gitk:532 +#: gitk:424 gitk:570 msgid "Reading" msgstr "Läser" -#: gitk:446 gitk:4271 +#: gitk:484 gitk:4353 msgid "Reading commits..." msgstr "Läser incheckningar..." -#: gitk:449 gitk:1580 gitk:4274 +#: gitk:487 gitk:1625 gitk:4356 msgid "No commits selected" msgstr "Inga incheckningar markerade" -#: gitk:1456 +#: gitk:1499 msgid "Can't parse git log output:" msgstr "Kan inte tolka utdata från git log:" -#: gitk:1676 +#: gitk:1719 msgid "No commit information available" msgstr "Ingen incheckningsinformation är tillgänglig" -#: gitk:1818 +#: gitk:1876 msgid "mc" msgstr "mc" -#: gitk:1853 gitk:4064 gitk:9067 gitk:10607 gitk:10817 +#: gitk:1911 gitk:4146 gitk:9282 gitk:10824 gitk:11100 msgid "OK" msgstr "OK" -#: gitk:1855 gitk:4066 gitk:8657 gitk:8736 gitk:8851 gitk:8900 gitk:9069 -#: gitk:10608 gitk:10818 +#: gitk:1913 gitk:4148 gitk:8871 gitk:8950 gitk:9065 gitk:9114 gitk:9284 +#: gitk:10825 gitk:11101 msgid "Cancel" msgstr "Avbryt" -#: gitk:1980 +#: gitk:2040 msgid "Update" msgstr "Uppdatera" -#: gitk:1981 +#: gitk:2041 msgid "Reload" msgstr "Ladda om" -#: gitk:1982 +#: gitk:2042 msgid "Reread references" msgstr "Läs om referenser" -#: gitk:1983 +#: gitk:2043 msgid "List references" msgstr "Visa referenser" -#: gitk:1985 +#: gitk:2045 msgid "Start git gui" msgstr "Starta git gui" -#: gitk:1987 +#: gitk:2047 msgid "Quit" msgstr "Avsluta" -#: gitk:1979 +#: gitk:2039 msgid "File" msgstr "Arkiv" -#: gitk:1991 +#: gitk:2051 msgid "Preferences" msgstr "Inställningar" -#: gitk:1990 +#: gitk:2050 msgid "Edit" msgstr "Redigera" -#: gitk:1995 +#: gitk:2055 msgid "New view..." msgstr "Ny vy..." -#: gitk:1996 +#: gitk:2056 msgid "Edit view..." msgstr "Ändra vy..." -#: gitk:1997 +#: gitk:2057 msgid "Delete view" msgstr "Ta bort vy" -#: gitk:1999 +#: gitk:2059 msgid "All files" msgstr "Alla filer" -#: gitk:1994 gitk:3817 +#: gitk:2054 gitk:3899 msgid "View" msgstr "Visa" -#: gitk:2004 gitk:2014 gitk:2787 +#: gitk:2064 gitk:2074 gitk:2869 msgid "About gitk" msgstr "Om gitk" -#: gitk:2005 gitk:2019 +#: gitk:2065 gitk:2079 msgid "Key bindings" msgstr "Tangentbordsbindningar" -#: gitk:2003 gitk:2018 +#: gitk:2063 gitk:2078 msgid "Help" msgstr "Hjälp" -#: gitk:2096 gitk:8132 +#: gitk:2156 gitk:8330 msgid "SHA1 ID:" msgstr "SHA1-id:" -#: gitk:2127 +#: gitk:2192 msgid "Row" msgstr "Rad" -#: gitk:2165 +#: gitk:2230 msgid "Find" msgstr "Sök" -#: gitk:2166 +#: gitk:2231 msgid "next" msgstr "nästa" -#: gitk:2167 +#: gitk:2232 msgid "prev" msgstr "föreg" -#: gitk:2168 +#: gitk:2233 msgid "commit" msgstr "incheckning" -#: gitk:2171 gitk:2173 gitk:4432 gitk:4455 gitk:4479 gitk:6420 gitk:6492 -#: gitk:6576 +#: gitk:2236 gitk:2238 gitk:4514 gitk:4537 gitk:4561 gitk:6528 gitk:6600 +#: gitk:6685 msgid "containing:" msgstr "som innehåller:" -#: gitk:2174 gitk:3298 gitk:3303 gitk:4507 +#: gitk:2239 gitk:3381 gitk:3386 gitk:4590 msgid "touching paths:" msgstr "som rör sökväg:" -#: gitk:2175 gitk:4512 +#: gitk:2240 gitk:4604 msgid "adding/removing string:" msgstr "som lägger/till tar bort sträng:" -#: gitk:2184 gitk:2186 +#: gitk:2249 gitk:2251 gitk:4593 msgid "Exact" msgstr "Exakt" -#: gitk:2186 gitk:4587 gitk:6388 +#: gitk:2251 gitk:4679 gitk:6496 msgid "IgnCase" msgstr "IgnVersaler" -#: gitk:2186 gitk:4481 gitk:4585 gitk:6384 +#: gitk:2251 gitk:4563 gitk:4677 gitk:6492 msgid "Regexp" msgstr "Reg.uttr." -#: gitk:2188 gitk:2189 gitk:4606 gitk:4636 gitk:4643 gitk:6512 gitk:6580 +#: gitk:2253 gitk:2254 gitk:4699 gitk:4729 gitk:4736 gitk:6621 gitk:6689 msgid "All fields" msgstr "Alla fält" -#: gitk:2189 gitk:4604 gitk:4636 gitk:6451 +#: gitk:2254 gitk:4696 gitk:4729 gitk:6559 msgid "Headline" msgstr "Rubrik" -#: gitk:2190 gitk:4604 gitk:6451 gitk:6580 gitk:7013 +#: gitk:2255 gitk:4696 gitk:6559 gitk:6689 gitk:7126 msgid "Comments" msgstr "Kommentarer" -#: gitk:2190 gitk:4604 gitk:4608 gitk:4643 gitk:6451 gitk:6948 gitk:8307 -#: gitk:8322 +#: gitk:2255 gitk:4696 gitk:4701 gitk:4736 gitk:6559 gitk:7061 gitk:8505 +#: gitk:8520 msgid "Author" msgstr "Författare" -#: gitk:2190 gitk:4604 gitk:6451 gitk:6950 +#: gitk:2255 gitk:4696 gitk:6559 gitk:7063 msgid "Committer" msgstr "Incheckare" -#: gitk:2221 +#: gitk:2286 msgid "Search" msgstr "Sök" -#: gitk:2229 +#: gitk:2294 msgid "Diff" msgstr "Diff" -#: gitk:2231 +#: gitk:2296 msgid "Old version" msgstr "Gammal version" -#: gitk:2233 +#: gitk:2298 msgid "New version" msgstr "Ny version" -#: gitk:2235 +#: gitk:2300 msgid "Lines of context" msgstr "Rader sammanhang" -#: gitk:2245 +#: gitk:2310 msgid "Ignore space change" msgstr "Ignorera ändringar i blanksteg" -#: gitk:2304 +#: gitk:2314 gitk:2316 gitk:7646 gitk:7874 +msgid "Line diff" +msgstr "Rad-diff" + +#: gitk:2379 msgid "Patch" msgstr "Patch" -#: gitk:2306 +#: gitk:2381 msgid "Tree" msgstr "Träd" -#: gitk:2463 gitk:2480 +#: gitk:2540 gitk:2559 msgid "Diff this -> selected" msgstr "Diff denna -> markerad" -#: gitk:2464 gitk:2481 +#: gitk:2541 gitk:2560 msgid "Diff selected -> this" msgstr "Diff markerad -> denna" -#: gitk:2465 gitk:2482 +#: gitk:2542 gitk:2561 msgid "Make patch" msgstr "Skapa patch" -#: gitk:2466 gitk:8715 +#: gitk:2543 gitk:8929 msgid "Create tag" msgstr "Skapa tagg" -#: gitk:2467 gitk:8831 +#: gitk:2544 gitk:9045 msgid "Write commit to file" msgstr "Skriv incheckning till fil" -#: gitk:2468 gitk:8888 +#: gitk:2545 gitk:9102 msgid "Create new branch" msgstr "Skapa ny gren" -#: gitk:2469 +#: gitk:2546 msgid "Cherry-pick this commit" msgstr "Plocka denna incheckning" -#: gitk:2470 +#: gitk:2547 msgid "Reset HEAD branch to here" msgstr "Återställ HEAD-grenen hit" -#: gitk:2471 +#: gitk:2548 msgid "Mark this commit" msgstr "Markera denna incheckning" -#: gitk:2472 +#: gitk:2549 msgid "Return to mark" msgstr "Återgå till markering" -#: gitk:2473 +#: gitk:2550 msgid "Find descendant of this and mark" msgstr "Hitta efterföljare till denna och markera" -#: gitk:2474 +#: gitk:2551 msgid "Compare with marked commit" msgstr "Jämför med markerad incheckning" -#: gitk:2488 +#: gitk:2552 gitk:2562 +msgid "Diff this -> marked commit" +msgstr "Diff denna -> markerad incheckning" + +#: gitk:2553 gitk:2563 +msgid "Diff marked commit -> this" +msgstr "Diff markerad incheckning -> denna" + +#: gitk:2569 msgid "Check out this branch" msgstr "Checka ut denna gren" -#: gitk:2489 +#: gitk:2570 msgid "Remove this branch" msgstr "Ta bort denna gren" -#: gitk:2496 +#: gitk:2577 msgid "Highlight this too" msgstr "Markera även detta" -#: gitk:2497 +#: gitk:2578 msgid "Highlight this only" msgstr "Markera bara detta" -#: gitk:2498 +#: gitk:2579 msgid "External diff" msgstr "Extern diff" -#: gitk:2499 +#: gitk:2580 msgid "Blame parent commit" msgstr "Klandra föräldraincheckning" -#: gitk:2506 +#: gitk:2587 msgid "Show origin of this line" msgstr "Visa ursprunget för den här raden" -#: gitk:2507 +#: gitk:2588 msgid "Run git gui blame on this line" msgstr "Kör git gui blame på den här raden" -#: gitk:2789 +#: gitk:2871 msgid "" "\n" "Gitk - a commit viewer for git\n" "\n" -"Copyright ©9 2005-2010 Paul Mackerras\n" +"Copyright ©9 2005-2011 Paul Mackerras\n" "\n" "Use and redistribute under the terms of the GNU General Public License" msgstr "" "\n" "Gitk - en incheckningsvisare för git\n" "\n" -"Copyright ©9 2005-2010 Paul Mackerras\n" +"Copyright ©9 2005-2011 Paul Mackerras\n" "\n" "Använd och vidareförmedla enligt villkoren i GNU General Public License" -#: gitk:2797 gitk:2862 gitk:9253 +#: gitk:2879 gitk:2944 gitk:9468 msgid "Close" msgstr "Stäng" -#: gitk:2818 +#: gitk:2900 msgid "Gitk key bindings" msgstr "Tangentbordsbindningar för Gitk" -#: gitk:2821 +#: gitk:2903 msgid "Gitk key bindings:" msgstr "Tangentbordsbindningar för Gitk:" -#: gitk:2823 +#: gitk:2905 #, tcl-format msgid "<%s-Q>\t\tQuit" msgstr "<%s-Q>\t\tAvsluta" -#: gitk:2824 +#: gitk:2906 #, tcl-format msgid "<%s-W>\t\tClose window" msgstr "<%s-W>\t\tStäng fönster" -#: gitk:2825 +#: gitk:2907 msgid "<Home>\t\tMove to first commit" msgstr "<Home>\t\tGå till första incheckning" -#: gitk:2826 +#: gitk:2908 msgid "<End>\t\tMove to last commit" msgstr "<End>\t\tGå till sista incheckning" -#: gitk:2827 -msgid "<Up>, p, i\tMove up one commit" -msgstr "<Upp>, p, i\tGå en incheckning upp" +#: gitk:2909 +msgid "<Up>, p, k\tMove up one commit" +msgstr "<Upp>, p, k\tGå en incheckning upp" -#: gitk:2828 -msgid "<Down>, n, k\tMove down one commit" -msgstr "<Ned>, n, k\tGå en incheckning ned" +#: gitk:2910 +msgid "<Down>, n, j\tMove down one commit" +msgstr "<Ned>, n, j\tGå en incheckning ned" -#: gitk:2829 -msgid "<Left>, z, j\tGo back in history list" -msgstr "<Vänster>, z, j\tGå bakåt i historiken" +#: gitk:2911 +msgid "<Left>, z, h\tGo back in history list" +msgstr "<Vänster>, z, h\tGå bakåt i historiken" -#: gitk:2830 +#: gitk:2912 msgid "<Right>, x, l\tGo forward in history list" msgstr "<Höger>, x, l\tGå framåt i historiken" -#: gitk:2831 +#: gitk:2913 msgid "<PageUp>\tMove up one page in commit list" msgstr "<PageUp>\tGå upp en sida i incheckningslistan" -#: gitk:2832 +#: gitk:2914 msgid "<PageDown>\tMove down one page in commit list" msgstr "<PageDown>\tGå ned en sida i incheckningslistan" -#: gitk:2833 +#: gitk:2915 #, tcl-format msgid "<%s-Home>\tScroll to top of commit list" msgstr "<%s-Home>\tRulla till början av incheckningslistan" -#: gitk:2834 +#: gitk:2916 #, tcl-format msgid "<%s-End>\tScroll to bottom of commit list" msgstr "<%s-End>\tRulla till slutet av incheckningslistan" -#: gitk:2835 +#: gitk:2917 #, tcl-format msgid "<%s-Up>\tScroll commit list up one line" msgstr "<%s-Upp>\tRulla incheckningslistan upp ett steg" -#: gitk:2836 +#: gitk:2918 #, tcl-format msgid "<%s-Down>\tScroll commit list down one line" msgstr "<%s-Ned>\tRulla incheckningslistan ned ett steg" -#: gitk:2837 +#: gitk:2919 #, tcl-format msgid "<%s-PageUp>\tScroll commit list up one page" msgstr "<%s-PageUp>\tRulla incheckningslistan upp en sida" -#: gitk:2838 +#: gitk:2920 #, tcl-format msgid "<%s-PageDown>\tScroll commit list down one page" msgstr "<%s-PageDown>\tRulla incheckningslistan ned en sida" -#: gitk:2839 +#: gitk:2921 msgid "<Shift-Up>\tFind backwards (upwards, later commits)" msgstr "<Skift-Upp>\tSök bakåt (uppåt, senare incheckningar)" -#: gitk:2840 +#: gitk:2922 msgid "<Shift-Down>\tFind forwards (downwards, earlier commits)" msgstr "<Skift-Ned>\tSök framåt (nedåt, tidigare incheckningar)" -#: gitk:2841 +#: gitk:2923 msgid "<Delete>, b\tScroll diff view up one page" msgstr "<Delete>, b\tRulla diffvisningen upp en sida" -#: gitk:2842 +#: gitk:2924 msgid "<Backspace>\tScroll diff view up one page" msgstr "<Baksteg>\tRulla diffvisningen upp en sida" -#: gitk:2843 +#: gitk:2925 msgid "<Space>\t\tScroll diff view down one page" msgstr "<Blanksteg>\tRulla diffvisningen ned en sida" -#: gitk:2844 +#: gitk:2926 msgid "u\t\tScroll diff view up 18 lines" msgstr "u\t\tRulla diffvisningen upp 18 rader" -#: gitk:2845 +#: gitk:2927 msgid "d\t\tScroll diff view down 18 lines" msgstr "d\t\tRulla diffvisningen ned 18 rader" -#: gitk:2846 +#: gitk:2928 #, tcl-format msgid "<%s-F>\t\tFind" msgstr "<%s-F>\t\tSök" -#: gitk:2847 +#: gitk:2929 #, tcl-format msgid "<%s-G>\t\tMove to next find hit" msgstr "<%s-G>\t\tGå till nästa sökträff" -#: gitk:2848 +#: gitk:2930 msgid "<Return>\tMove to next find hit" msgstr "<Return>\t\tGå till nästa sökträff" -#: gitk:2849 +#: gitk:2931 msgid "/\t\tFocus the search box" msgstr "/\t\tFokusera sökrutan" -#: gitk:2850 +#: gitk:2932 msgid "?\t\tMove to previous find hit" msgstr "?\t\tGå till föregående sökträff" -#: gitk:2851 +#: gitk:2933 msgid "f\t\tScroll diff view to next file" msgstr "f\t\tRulla diffvisningen till nästa fil" -#: gitk:2852 +#: gitk:2934 #, tcl-format msgid "<%s-S>\t\tSearch for next hit in diff view" msgstr "<%s-S>\t\tGå till nästa sökträff i diffvisningen" -#: gitk:2853 +#: gitk:2935 #, tcl-format msgid "<%s-R>\t\tSearch for previous hit in diff view" msgstr "<%s-R>\t\tGå till föregående sökträff i diffvisningen" -#: gitk:2854 +#: gitk:2936 #, tcl-format msgid "<%s-KP+>\tIncrease font size" msgstr "<%s-Num+>\tÖka teckenstorlek" -#: gitk:2855 +#: gitk:2937 #, tcl-format msgid "<%s-plus>\tIncrease font size" msgstr "<%s-plus>\tÖka teckenstorlek" -#: gitk:2856 +#: gitk:2938 #, tcl-format msgid "<%s-KP->\tDecrease font size" msgstr "<%s-Num->\tMinska teckenstorlek" -#: gitk:2857 +#: gitk:2939 #, tcl-format msgid "<%s-minus>\tDecrease font size" msgstr "<%s-minus>\tMinska teckenstorlek" -#: gitk:2858 +#: gitk:2940 msgid "<F5>\t\tUpdate" msgstr "<F5>\t\tUppdatera" -#: gitk:3313 gitk:3322 +#: gitk:3395 gitk:3404 #, tcl-format msgid "Error creating temporary directory %s:" msgstr "Fel vid skapande av temporär katalog %s:" -#: gitk:3335 +#: gitk:3417 #, tcl-format msgid "Error getting \"%s\" from %s:" msgstr "Fel vid hämtning av \"%s\" från %s:" -#: gitk:3398 +#: gitk:3480 msgid "command failed:" msgstr "kommando misslyckades:" -#: gitk:3547 +#: gitk:3629 msgid "No such commit" msgstr "Incheckning saknas" -#: gitk:3561 +#: gitk:3643 msgid "git gui blame: command failed:" msgstr "git gui blame: kommando misslyckades:" -#: gitk:3592 +#: gitk:3674 #, tcl-format msgid "Couldn't read merge head: %s" msgstr "Kunde inte läsa sammanslagningshuvud: %s" -#: gitk:3600 +#: gitk:3682 #, tcl-format msgid "Error reading index: %s" msgstr "Fel vid läsning av index: %s" -#: gitk:3625 +#: gitk:3707 #, tcl-format msgid "Couldn't start git blame: %s" msgstr "Kunde inte starta git blame: %s" -#: gitk:3628 gitk:6419 +#: gitk:3710 gitk:6527 msgid "Searching" msgstr "Söker" -#: gitk:3660 +#: gitk:3742 #, tcl-format msgid "Error running git blame: %s" msgstr "Fel vid körning av git blame: %s" -#: gitk:3688 +#: gitk:3770 #, tcl-format msgid "That line comes from commit %s, which is not in this view" msgstr "Raden kommer från incheckningen %s, som inte finns i denna vy" -#: gitk:3702 +#: gitk:3784 msgid "External diff viewer failed:" msgstr "Externt diff-verktyg misslyckades:" -#: gitk:3820 +#: gitk:3902 msgid "Gitk view definition" msgstr "Definition av Gitk-vy" -#: gitk:3824 +#: gitk:3906 msgid "Remember this view" msgstr "Spara denna vy" -#: gitk:3825 +#: gitk:3907 msgid "References (space separated list):" msgstr "Referenser (blankstegsavdelad lista):" -#: gitk:3826 +#: gitk:3908 msgid "Branches & tags:" msgstr "Grenar & taggar:" -#: gitk:3827 +#: gitk:3909 msgid "All refs" msgstr "Alla referenser" -#: gitk:3828 +#: gitk:3910 msgid "All (local) branches" msgstr "Alla (lokala) grenar" -#: gitk:3829 +#: gitk:3911 msgid "All tags" msgstr "Alla taggar" -#: gitk:3830 +#: gitk:3912 msgid "All remote-tracking branches" msgstr "Alla fjärrspårande grenar" -#: gitk:3831 +#: gitk:3913 msgid "Commit Info (regular expressions):" msgstr "Incheckningsinfo (reguljära uttryck):" -#: gitk:3832 +#: gitk:3914 msgid "Author:" msgstr "Författare:" -#: gitk:3833 +#: gitk:3915 msgid "Committer:" msgstr "Incheckare:" -#: gitk:3834 +#: gitk:3916 msgid "Commit Message:" msgstr "Incheckningsmeddelande:" -#: gitk:3835 +#: gitk:3917 msgid "Matches all Commit Info criteria" msgstr "Motsvarar alla kriterier för incheckningsinfo" -#: gitk:3836 +#: gitk:3918 msgid "Changes to Files:" msgstr "Ändringar av filer:" -#: gitk:3837 +#: gitk:3919 msgid "Fixed String" msgstr "Fast sträng" -#: gitk:3838 +#: gitk:3920 msgid "Regular Expression" msgstr "Reguljärt uttryck" -#: gitk:3839 +#: gitk:3921 msgid "Search string:" msgstr "Söksträng:" -#: gitk:3840 +#: gitk:3922 msgid "" "Commit Dates (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 " "15:27:38\"):" @@ -648,201 +670,197 @@ msgstr "" "Incheckingsdatum (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 " "15:27:38\"):" -#: gitk:3841 +#: gitk:3923 msgid "Since:" msgstr "Från:" -#: gitk:3842 +#: gitk:3924 msgid "Until:" msgstr "Till:" -#: gitk:3843 +#: gitk:3925 msgid "Limit and/or skip a number of revisions (positive integer):" msgstr "Begränsa och/eller hoppa över ett antal revisioner (positivt heltal):" -#: gitk:3844 +#: gitk:3926 msgid "Number to show:" msgstr "Antal att visa:" -#: gitk:3845 +#: gitk:3927 msgid "Number to skip:" msgstr "Antal att hoppa över:" -#: gitk:3846 +#: gitk:3928 msgid "Miscellaneous options:" msgstr "Diverse alternativ:" -#: gitk:3847 +#: gitk:3929 msgid "Strictly sort by date" msgstr "Strikt datumsortering" -#: gitk:3848 +#: gitk:3930 msgid "Mark branch sides" msgstr "Markera sidogrenar" -#: gitk:3849 +#: gitk:3931 msgid "Limit to first parent" msgstr "Begränsa till första förälder" -#: gitk:3850 +#: gitk:3932 msgid "Simple history" msgstr "Enkel historik" -#: gitk:3851 +#: gitk:3933 msgid "Additional arguments to git log:" msgstr "Ytterligare argument till git log:" -#: gitk:3852 +#: gitk:3934 msgid "Enter files and directories to include, one per line:" msgstr "Ange filer och kataloger att ta med, en per rad:" -#: gitk:3853 +#: gitk:3935 msgid "Command to generate more commits to include:" msgstr "Kommando för att generera fler incheckningar att ta med:" -#: gitk:3977 +#: gitk:4059 msgid "Gitk: edit view" msgstr "Gitk: redigera vy" -#: gitk:3985 +#: gitk:4067 msgid "-- criteria for selecting revisions" msgstr " - kriterier för val av revisioner" -#: gitk:3990 +#: gitk:4072 msgid "View Name" msgstr "Namn på vy" -#: gitk:4065 +#: gitk:4147 msgid "Apply (F5)" msgstr "Använd (F5)" -#: gitk:4103 +#: gitk:4185 msgid "Error in commit selection arguments:" msgstr "Fel i argument för val av incheckningar:" -#: gitk:4156 gitk:4208 gitk:4656 gitk:4670 gitk:5931 gitk:11551 gitk:11552 +#: gitk:4238 gitk:4290 gitk:4749 gitk:4763 gitk:6027 gitk:11849 gitk:11850 msgid "None" msgstr "Inget" -#: gitk:4604 gitk:6451 gitk:8309 gitk:8324 -msgid "Date" -msgstr "Datum" - -#: gitk:4604 gitk:6451 -msgid "CDate" -msgstr "Skapat datum" - -#: gitk:4753 gitk:4758 +#: gitk:4846 gitk:4851 msgid "Descendant" msgstr "Avkomling" -#: gitk:4754 +#: gitk:4847 msgid "Not descendant" msgstr "Inte avkomling" -#: gitk:4761 gitk:4766 +#: gitk:4854 gitk:4859 msgid "Ancestor" msgstr "Förfader" -#: gitk:4762 +#: gitk:4855 msgid "Not ancestor" msgstr "Inte förfader" -#: gitk:5052 +#: gitk:5145 msgid "Local changes checked in to index but not committed" msgstr "Lokala ändringar sparade i indexet men inte incheckade" -#: gitk:5088 +#: gitk:5181 msgid "Local uncommitted changes, not checked in to index" msgstr "Lokala ändringar, ej sparade i indexet" -#: gitk:6769 +#: gitk:6882 msgid "many" msgstr "många" -#: gitk:6952 +#: gitk:7065 msgid "Tags:" msgstr "Taggar:" -#: gitk:6969 gitk:6975 gitk:8302 +#: gitk:7082 gitk:7088 gitk:8500 msgid "Parent" msgstr "Förälder" -#: gitk:6980 +#: gitk:7093 msgid "Child" msgstr "Barn" -#: gitk:6989 +#: gitk:7102 msgid "Branch" msgstr "Gren" -#: gitk:6992 +#: gitk:7105 msgid "Follows" msgstr "Följer" -#: gitk:6995 +#: gitk:7108 msgid "Precedes" msgstr "Föregår" -#: gitk:7532 +#: gitk:7653 #, tcl-format msgid "Error getting diffs: %s" msgstr "Fel vid hämtning av diff: %s" -#: gitk:8130 +#: gitk:8328 msgid "Goto:" msgstr "Gå till:" -#: gitk:8151 +#: gitk:8349 #, tcl-format msgid "Short SHA1 id %s is ambiguous" msgstr "Förkortat SHA1-id %s är tvetydigt" -#: gitk:8158 +#: gitk:8356 #, tcl-format msgid "Revision %s is not known" msgstr "Revisionen %s är inte känd" -#: gitk:8168 +#: gitk:8366 #, tcl-format msgid "SHA1 id %s is not known" msgstr "SHA-id:t %s är inte känt" -#: gitk:8170 +#: gitk:8368 #, tcl-format msgid "Revision %s is not in the current view" msgstr "Revisionen %s finns inte i den nuvarande vyn" -#: gitk:8312 +#: gitk:8507 gitk:8522 +msgid "Date" +msgstr "Datum" + +#: gitk:8510 msgid "Children" msgstr "Barn" -#: gitk:8370 +#: gitk:8573 #, tcl-format msgid "Reset %s branch to here" msgstr "Återställ grenen %s hit" -#: gitk:8372 +#: gitk:8575 msgid "Detached head: can't reset" msgstr "Frånkopplad head: kan inte återställa" -#: gitk:8481 gitk:8487 +#: gitk:8680 gitk:8686 msgid "Skipping merge commit " msgstr "Hoppar över sammanslagningsincheckning " -#: gitk:8496 gitk:8501 +#: gitk:8695 gitk:8700 msgid "Error getting patch ID for " msgstr "Fel vid hämtning av patch-id för " -#: gitk:8497 gitk:8502 +#: gitk:8696 gitk:8701 msgid " - stopping\n" msgstr " - stannar\n" -#: gitk:8507 gitk:8510 gitk:8518 gitk:8532 gitk:8541 +#: gitk:8706 gitk:8709 gitk:8717 gitk:8731 gitk:8740 msgid "Commit " msgstr "Incheckning " -#: gitk:8511 +#: gitk:8710 msgid "" " is the same patch as\n" " " @@ -850,7 +868,7 @@ msgstr "" " är samma patch som\n" " " -#: gitk:8519 +#: gitk:8718 msgid "" " differs from\n" " " @@ -858,7 +876,7 @@ msgstr "" " skiljer sig från\n" " " -#: gitk:8521 +#: gitk:8720 msgid "" "Diff of commits:\n" "\n" @@ -866,131 +884,131 @@ msgstr "" "Skillnad mellan incheckningar:\n" "\n" -#: gitk:8533 gitk:8542 +#: gitk:8732 gitk:8741 #, tcl-format msgid " has %s children - stopping\n" msgstr " har %s barn - stannar\n" -#: gitk:8561 +#: gitk:8760 #, tcl-format msgid "Error writing commit to file: %s" msgstr "Fel vid skrivning av incheckning till fil: %s" -#: gitk:8567 +#: gitk:8766 #, tcl-format msgid "Error diffing commits: %s" msgstr "Fel vid jämförelse av incheckningar: %s" -#: gitk:8598 +#: gitk:8812 msgid "Top" msgstr "Topp" -#: gitk:8599 +#: gitk:8813 msgid "From" msgstr "Från" -#: gitk:8604 +#: gitk:8818 msgid "To" msgstr "Till" -#: gitk:8628 +#: gitk:8842 msgid "Generate patch" msgstr "Generera patch" -#: gitk:8630 +#: gitk:8844 msgid "From:" msgstr "Från:" -#: gitk:8639 +#: gitk:8853 msgid "To:" msgstr "Till:" -#: gitk:8648 +#: gitk:8862 msgid "Reverse" msgstr "Vänd" -#: gitk:8650 gitk:8845 +#: gitk:8864 gitk:9059 msgid "Output file:" msgstr "Utdatafil:" -#: gitk:8656 +#: gitk:8870 msgid "Generate" msgstr "Generera" -#: gitk:8694 +#: gitk:8908 msgid "Error creating patch:" msgstr "Fel vid generering av patch:" -#: gitk:8717 gitk:8833 gitk:8890 +#: gitk:8931 gitk:9047 gitk:9104 msgid "ID:" msgstr "Id:" -#: gitk:8726 +#: gitk:8940 msgid "Tag name:" msgstr "Taggnamn:" -#: gitk:8729 +#: gitk:8943 msgid "Tag message is optional" msgstr "Taggmeddelandet är valfritt" -#: gitk:8731 +#: gitk:8945 msgid "Tag message:" msgstr "Taggmeddelande:" -#: gitk:8735 gitk:8899 +#: gitk:8949 gitk:9113 msgid "Create" msgstr "Skapa" -#: gitk:8753 +#: gitk:8967 msgid "No tag name specified" msgstr "Inget taggnamn angavs" -#: gitk:8757 +#: gitk:8971 #, tcl-format msgid "Tag \"%s\" already exists" msgstr "Taggen \"%s\" finns redan" -#: gitk:8767 +#: gitk:8981 msgid "Error creating tag:" msgstr "Fel vid skapande av tagg:" -#: gitk:8842 +#: gitk:9056 msgid "Command:" msgstr "Kommando:" -#: gitk:8850 +#: gitk:9064 msgid "Write" msgstr "Skriv" -#: gitk:8868 +#: gitk:9082 msgid "Error writing commit:" msgstr "Fel vid skrivning av incheckning:" -#: gitk:8895 +#: gitk:9109 msgid "Name:" msgstr "Namn:" -#: gitk:8918 +#: gitk:9132 msgid "Please specify a name for the new branch" msgstr "Ange ett namn för den nya grenen" -#: gitk:8923 +#: gitk:9137 #, tcl-format msgid "Branch '%s' already exists. Overwrite?" msgstr "Grenen \"%s\" finns redan. Skriva över?" -#: gitk:8989 +#: gitk:9204 #, tcl-format msgid "Commit %s is already included in branch %s -- really re-apply it?" msgstr "" "Incheckningen %s finns redan på grenen %s -- skall den verkligen appliceras " "på nytt?" -#: gitk:8994 +#: gitk:9209 msgid "Cherry-picking" msgstr "Plockar" -#: gitk:9003 +#: gitk:9218 #, tcl-format msgid "" "Cherry-pick failed because of local changes to file '%s'.\n" @@ -1000,7 +1018,7 @@ msgstr "" "Checka in, återställ eller spara undan (stash) dina ändringar och försök " "igen." -#: gitk:9009 +#: gitk:9224 msgid "" "Cherry-pick failed because of merge conflict.\n" "Do you wish to run git citool to resolve it?" @@ -1008,32 +1026,32 @@ msgstr "" "Cherry-pick misslyckades på grund av en sammanslagningskonflikt.\n" "Vill du köra git citool för att lösa den?" -#: gitk:9025 +#: gitk:9240 msgid "No changes committed" msgstr "Inga ändringar incheckade" -#: gitk:9051 +#: gitk:9266 msgid "Confirm reset" msgstr "Bekräfta återställning" -#: gitk:9053 +#: gitk:9268 #, tcl-format msgid "Reset branch %s to %s?" msgstr "Återställa grenen %s till %s?" -#: gitk:9055 +#: gitk:9270 msgid "Reset type:" msgstr "Typ av återställning:" -#: gitk:9058 +#: gitk:9273 msgid "Soft: Leave working tree and index untouched" msgstr "Mjuk: Rör inte utcheckning och index" -#: gitk:9061 +#: gitk:9276 msgid "Mixed: Leave working tree untouched, reset index" msgstr "Blandad: Rör inte utcheckning, återställ index" -#: gitk:9064 +#: gitk:9279 msgid "" "Hard: Reset working tree and index\n" "(discard ALL local changes)" @@ -1041,19 +1059,19 @@ msgstr "" "Hård: Återställ utcheckning och index\n" "(förkastar ALLA lokala ändringar)" -#: gitk:9081 +#: gitk:9296 msgid "Resetting" msgstr "Återställer" -#: gitk:9141 +#: gitk:9356 msgid "Checking out" msgstr "Checkar ut" -#: gitk:9194 +#: gitk:9409 msgid "Cannot delete the currently checked-out branch" msgstr "Kan inte ta bort den just nu utcheckade grenen" -#: gitk:9200 +#: gitk:9415 #, tcl-format msgid "" "The commits on branch %s aren't on any other branch.\n" @@ -1062,16 +1080,16 @@ msgstr "" "Incheckningarna på grenen %s existerar inte på någon annan gren.\n" "Vill du verkligen ta bort grenen %s?" -#: gitk:9231 +#: gitk:9446 #, tcl-format msgid "Tags and heads: %s" msgstr "Taggar och huvuden: %s" -#: gitk:9246 +#: gitk:9461 msgid "Filter" msgstr "Filter" -#: gitk:9541 +#: gitk:9757 msgid "" "Error reading commit topology information; branch and preceding/following " "tag information will be incomplete." @@ -1079,206 +1097,219 @@ msgstr "" "Fel vid läsning av information om incheckningstopologi; information om " "grenar och föregående/senare taggar kommer inte vara komplett." -#: gitk:10527 +#: gitk:10744 msgid "Tag" msgstr "Tagg" -#: gitk:10527 +#: gitk:10744 msgid "Id" msgstr "Id" -#: gitk:10576 +#: gitk:10793 msgid "Gitk font chooser" msgstr "Teckensnittsväljare för Gitk" -#: gitk:10593 +#: gitk:10810 msgid "B" msgstr "F" -#: gitk:10596 +#: gitk:10813 msgid "I" msgstr "K" -#: gitk:10714 -msgid "Gitk preferences" -msgstr "Inställningar för Gitk" - -#: gitk:10716 +#: gitk:10931 msgid "Commit list display options" msgstr "Alternativ för incheckningslistvy" -#: gitk:10719 +#: gitk:10934 msgid "Maximum graph width (lines)" msgstr "Maximal grafbredd (rader)" -#: gitk:10722 +#: gitk:10937 #, tcl-format msgid "Maximum graph width (% of pane)" msgstr "Maximal grafbredd (% av ruta)" -#: gitk:10725 +#: gitk:10940 msgid "Show local changes" msgstr "Visa lokala ändringar" -#: gitk:10728 -msgid "Auto-select SHA1" -msgstr "Välj SHA1 automatiskt" +#: gitk:10943 +msgid "Auto-select SHA1 (length)" +msgstr "Välj SHA1 (längd) automatiskt" -#: gitk:10731 +#: gitk:10947 msgid "Hide remote refs" msgstr "Dölj fjärr-referenser" -#: gitk:10735 +#: gitk:10951 msgid "Diff display options" msgstr "Alternativ för diffvy" -#: gitk:10737 +#: gitk:10953 msgid "Tab spacing" msgstr "Blanksteg för tabulatortecken" -#: gitk:10740 +#: gitk:10956 msgid "Display nearby tags" msgstr "Visa närliggande taggar" -#: gitk:10743 +#: gitk:10959 msgid "Limit diffs to listed paths" msgstr "Begränsa diff till listade sökvägar" -#: gitk:10746 +#: gitk:10962 msgid "Support per-file encodings" msgstr "Stöd för filspecifika teckenkodningar" -#: gitk:10752 gitk:10832 +#: gitk:10968 gitk:11115 msgid "External diff tool" msgstr "Externt diff-verktyg" -#: gitk:10753 +#: gitk:10969 msgid "Choose..." msgstr "Välj..." -#: gitk:10758 +#: gitk:10974 msgid "General options" msgstr "Allmänna inställningar" -#: gitk:10761 +#: gitk:10977 msgid "Use themed widgets" msgstr "Använd tema på fönsterelement" -#: gitk:10763 +#: gitk:10979 msgid "(change requires restart)" msgstr "(ändringen kräver omstart)" -#: gitk:10765 +#: gitk:10981 msgid "(currently unavailable)" msgstr "(för närvarande inte tillgängligt)" -#: gitk:10769 +#: gitk:10992 msgid "Colors: press to choose" msgstr "Färger: tryck för att välja" -#: gitk:10772 +#: gitk:10995 msgid "Interface" msgstr "Gränssnitt" -#: gitk:10773 +#: gitk:10996 msgid "interface" msgstr "gränssnitt" -#: gitk:10776 +#: gitk:10999 msgid "Background" msgstr "Bakgrund" -#: gitk:10777 gitk:10807 +#: gitk:11000 gitk:11030 msgid "background" msgstr "bakgrund" -#: gitk:10780 +#: gitk:11003 msgid "Foreground" msgstr "Förgrund" -#: gitk:10781 +#: gitk:11004 msgid "foreground" msgstr "förgrund" -#: gitk:10784 +#: gitk:11007 msgid "Diff: old lines" msgstr "Diff: gamla rader" -#: gitk:10785 +#: gitk:11008 msgid "diff old lines" msgstr "diff gamla rader" -#: gitk:10789 +#: gitk:11012 msgid "Diff: new lines" msgstr "Diff: nya rader" -#: gitk:10790 +#: gitk:11013 msgid "diff new lines" msgstr "diff nya rader" -#: gitk:10794 +#: gitk:11017 msgid "Diff: hunk header" msgstr "Diff: delhuvud" -#: gitk:10796 +#: gitk:11019 msgid "diff hunk header" msgstr "diff delhuvud" -#: gitk:10800 +#: gitk:11023 msgid "Marked line bg" msgstr "Markerad rad bakgrund" -#: gitk:10802 +#: gitk:11025 msgid "marked line background" msgstr "markerad rad bakgrund" -#: gitk:10806 +#: gitk:11029 msgid "Select bg" msgstr "Markerad bakgrund" -#: gitk:10810 +#: gitk:11038 msgid "Fonts: press to choose" msgstr "Teckensnitt: tryck för att välja" -#: gitk:10812 +#: gitk:11040 msgid "Main font" msgstr "Huvudteckensnitt" -#: gitk:10813 +#: gitk:11041 msgid "Diff display font" msgstr "Teckensnitt för diffvisning" -#: gitk:10814 +#: gitk:11042 msgid "User interface font" msgstr "Teckensnitt för användargränssnitt" -#: gitk:10842 +#: gitk:11064 +msgid "Gitk preferences" +msgstr "Inställningar för Gitk" + +#: gitk:11073 +msgid "General" +msgstr "Allmänt" + +#: gitk:11074 +msgid "Colors" +msgstr "Färger" + +#: gitk:11075 +msgid "Fonts" +msgstr "Teckensnitt" + +#: gitk:11125 #, tcl-format msgid "Gitk: choose color for %s" msgstr "Gitk: välj färg för %s" -#: gitk:11445 +#: gitk:11745 msgid "Cannot find a git repository here." msgstr "Hittar inget git-arkiv här." -#: gitk:11449 -#, tcl-format -msgid "Cannot find the git directory \"%s\"." -msgstr "Hittar inte git-katalogen \"%s\"." - -#: gitk:11496 +#: gitk:11792 #, tcl-format msgid "Ambiguous argument '%s': both revision and filename" msgstr "Tvetydigt argument \"%s\": både revision och filnamn" -#: gitk:11508 +#: gitk:11804 msgid "Bad arguments to gitk:" msgstr "Felaktiga argument till gitk:" -#: gitk:11604 +#: gitk:11907 msgid "Command line" msgstr "Kommandorad" +#~ msgid "CDate" +#~ msgstr "Skapat datum" + +#~ msgid "Cannot find the git directory \"%s\"." +#~ msgstr "Hittar inte git-katalogen \"%s\"." + #~ msgid "SHA1 ID: " #~ msgstr "SHA1-id: " |