@@ -1601,13 +1601,14 @@ proc parsecommit {id contents listed} {
1601
1601
set header [string range $contents 0 [expr {$hdrend - 1}]]
1602
1602
set comment [string range $contents [expr {$hdrend + 2}] end]
1603
1603
foreach line [split $header " \n " ] {
1604
+ set line [split $line " " ]
1604
1605
set tag [lindex $line 0]
1605
1606
if {$tag == " author" } {
1606
1607
set audate [lindex $line end-1]
1607
- set auname [lrange $line 1 end-2]
1608
+ set auname [join [ lrange $line 1 end-2] " " ]
1608
1609
} elseif {$tag == " committer" } {
1609
1610
set comdate [lindex $line end-1]
1610
- set comname [lrange $line 1 end-2]
1611
+ set comname [join [ lrange $line 1 end-2] " " ]
1611
1612
}
1612
1613
}
1613
1614
set headline {}
@@ -2279,7 +2280,7 @@ proc makewindow {} {
2279
2280
bindkey b prevfile
2280
2281
bindkey d " $ctext yview scroll 18 units"
2281
2282
bindkey u " $ctext yview scroll -18 units"
2282
- bindkey / {dofind 1 1 }
2283
+ bindkey / {focus $fstring }
2283
2284
bindkey <Key-Return> {dofind 1 1}
2284
2285
bindkey ? {dofind -1 1}
2285
2286
bindkey f nextfile
@@ -2660,7 +2661,7 @@ proc keys {} {
2660
2661
[ mc " <%s-F> Find" $M1T ]
2661
2662
[ mc " <%s-G> Move to next find hit" $M1T ]
2662
2663
[ mc " <Return> Move to next find hit" ]
2663
- [ mc " / Move to next find hit, or redo find " ]
2664
+ [ mc " / Focus the search box " ]
2664
2665
[ mc " ? Move to previous find hit" ]
2665
2666
[ mc " f Scroll diff view to next file" ]
2666
2667
[ mc " <%s-S> Search for next hit in diff view" $M1T ]
@@ -3318,8 +3319,27 @@ proc index_sha1 {fname} {
3318
3319
return {}
3319
3320
}
3320
3321
3322
+ # Turn an absolute path into one relative to the current directory
3323
+ proc make_relative {f} {
3324
+ set elts [file split $f ]
3325
+ set here [file split [pwd ]]
3326
+ set ei 0
3327
+ set hi 0
3328
+ set res {}
3329
+ foreach d $here {
3330
+ if {$ei < $hi || $ei >= [llength $elts ] || [lindex $elts $ei ] ne $d } {
3331
+ lappend res " .."
3332
+ } else {
3333
+ incr ei
3334
+ }
3335
+ incr hi
3336
+ }
3337
+ set elts [concat $res [lrange $elts $ei end]]
3338
+ return [eval file join $elts ]
3339
+ }
3340
+
3321
3341
proc external_blame {parent_idx {line {}}} {
3322
- global flist_menu_file
3342
+ global flist_menu_file gitdir
3323
3343
global nullid nullid2
3324
3344
global parentlist selectedline currentid
3325
3345
@@ -3338,7 +3358,12 @@ proc external_blame {parent_idx {line {}}} {
3338
3358
if {$line ne {} && $line > 1} {
3339
3359
lappend cmdline " --line=$line "
3340
3360
}
3341
- lappend cmdline $base_commit $flist_menu_file
3361
+ set f [file join [file dirname $gitdir ] $flist_menu_file ]
3362
+ # Unfortunately it seems git gui blame doesn't like
3363
+ # being given an absolute path...
3364
+ set f [make_relative $f ]
3365
+ lappend cmdline $base_commit $f
3366
+ puts " cmdline={$cmdline }"
3342
3367
if {[catch {eval exec $cmdline &} err]} {
3343
3368
error_popup " [ mc " git gui blame: command failed:" ] $err "
3344
3369
}
@@ -3382,6 +3407,8 @@ proc show_line_source {} {
3382
3407
error_popup [mc " Error reading index: %s" $err ]
3383
3408
return
3384
3409
}
3410
+ } else {
3411
+ set id $parents($curview,$currentid)
3385
3412
}
3386
3413
} else {
3387
3414
set id [lindex $parents($curview,$currentid) $pi ]
@@ -3398,7 +3425,7 @@ proc show_line_source {} {
3398
3425
} else {
3399
3426
lappend blameargs $id
3400
3427
}
3401
- lappend blameargs -- $ flist_menu_file
3428
+ lappend blameargs -- [ file join [ file dirname $gitdir ] $ flist_menu_file]
3402
3429
if {[catch {
3403
3430
set f [open $blameargs r]
3404
3431
} err]} {
@@ -7953,7 +7980,7 @@ proc rowmenu {x y id} {
7953
7980
if {$id ne $nullid && $id ne $nullid2 } {
7954
7981
set menu $rowctxmenu
7955
7982
if {$mainhead ne {}} {
7956
- $menu entryconfigure 7 -label [mc " Reset %s branch to here" $mainhead ]
7983
+ $menu entryconfigure 7 -label [mc " Reset %s branch to here" $mainhead ] -state normal
7957
7984
} else {
7958
7985
$menu entryconfigure 7 -label [mc " Detached head: can't reset" $mainhead ] -state disabled
7959
7986
}
@@ -10079,36 +10106,26 @@ proc doprefs {} {
10079
10106
-font optionfont
10080
10107
spinbox $top .maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct
10081
10108
grid x $top .maxpctl $top .maxpct -sticky w
10082
- frame $top .showlocal
10083
- label $top .showlocal.l -text [mc " Show local changes" ] -font optionfont
10084
- checkbutton $top .showlocal.b -variable showlocalchanges
10085
- pack $top .showlocal.b $top .showlocal.l -side left
10109
+ checkbutton $top .showlocal -text [mc " Show local changes" ] \
10110
+ -font optionfont -variable showlocalchanges
10086
10111
grid x $top .showlocal -sticky w
10087
- frame $top .autoselect
10088
- label $top .autoselect.l -text [mc " Auto-select SHA1" ] -font optionfont
10089
- checkbutton $top .autoselect.b -variable autoselect
10090
- pack $top .autoselect.b $top .autoselect.l -side left
10112
+ checkbutton $top .autoselect -text [mc " Auto-select SHA1" ] \
10113
+ -font optionfont -variable autoselect
10091
10114
grid x $top .autoselect -sticky w
10092
10115
10093
10116
label $top .ddisp -text [mc " Diff display options" ]
10094
10117
grid $top .ddisp - -sticky w -pady 10
10095
10118
label $top .tabstopl -text [mc " Tab spacing" ] -font optionfont
10096
10119
spinbox $top .tabstop -from 1 -to 20 -width 4 -textvariable tabstop
10097
10120
grid x $top .tabstopl $top .tabstop -sticky w
10098
- frame $top .ntag
10099
- label $top .ntag.l -text [mc " Display nearby tags" ] -font optionfont
10100
- checkbutton $top .ntag.b -variable showneartags
10101
- pack $top .ntag.b $top .ntag.l -side left
10121
+ checkbutton $top .ntag -text [mc " Display nearby tags" ] \
10122
+ -font optionfont -variable showneartags
10102
10123
grid x $top .ntag -sticky w
10103
- frame $top .ldiff
10104
- label $top .ldiff.l -text [mc " Limit diffs to listed paths" ] -font optionfont
10105
- checkbutton $top .ldiff.b -variable limitdiffs
10106
- pack $top .ldiff.b $top .ldiff.l -side left
10124
+ checkbutton $top .ldiff -text [mc " Limit diffs to listed paths" ] \
10125
+ -font optionfont -variable limitdiffs
10107
10126
grid x $top .ldiff -sticky w
10108
- frame $top .lattr
10109
- label $top .lattr.l -text [mc " Support per-file encodings" ] -font optionfont
10110
- checkbutton $top .lattr.b -variable perfile_attrs
10111
- pack $top .lattr.b $top .lattr.l -side left
10127
+ checkbutton $top .lattr -text [mc " Support per-file encodings" ] \
10128
+ -font optionfont -variable perfile_attrs
10112
10129
grid x $top .lattr -sticky w
10113
10130
10114
10131
entry $top .extdifft -textvariable extdifftool
@@ -10124,26 +10141,26 @@ proc doprefs {} {
10124
10141
grid $top .cdisp - -sticky w -pady 10
10125
10142
label $top .bg -padx 40 -relief sunk -background $bgcolor
10126
10143
button $top .bgbut -text [mc " Background" ] -font optionfont \
10127
- -command [list choosecolor bgcolor {} $top .bg background setbg]
10144
+ -command [list choosecolor bgcolor {} $top .bg [mc " background" ] setbg]
10128
10145
grid x $top .bgbut $top .bg -sticky w
10129
10146
label $top .fg -padx 40 -relief sunk -background $fgcolor
10130
10147
button $top .fgbut -text [mc " Foreground" ] -font optionfont \
10131
- -command [list choosecolor fgcolor {} $top .fg foreground setfg]
10148
+ -command [list choosecolor fgcolor {} $top .fg [mc " foreground" ] setfg]
10132
10149
grid x $top .fgbut $top .fg -sticky w
10133
10150
label $top .diffold -padx 40 -relief sunk -background [lindex $diffcolors 0]
10134
10151
button $top .diffoldbut -text [mc " Diff: old lines" ] -font optionfont \
10135
- -command [list choosecolor diffcolors 0 $top .diffold " diff old lines" \
10152
+ -command [list choosecolor diffcolors 0 $top .diffold [mc " diff old lines" ] \
10136
10153
[list $ctext tag conf d0 -foreground]]
10137
10154
grid x $top .diffoldbut $top .diffold -sticky w
10138
10155
label $top .diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1]
10139
10156
button $top .diffnewbut -text [mc " Diff: new lines" ] -font optionfont \
10140
- -command [list choosecolor diffcolors 1 $top .diffnew " diff new lines" \
10157
+ -command [list choosecolor diffcolors 1 $top .diffnew [mc " diff new lines" ] \
10141
10158
[list $ctext tag conf dresult -foreground]]
10142
10159
grid x $top .diffnewbut $top .diffnew -sticky w
10143
10160
label $top .hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2]
10144
10161
button $top .hunksepbut -text [mc " Diff: hunk header" ] -font optionfont \
10145
10162
-command [list choosecolor diffcolors 2 $top .hunksep \
10146
- " diff hunk header" \
10163
+ [mc " diff hunk header" ] \
10147
10164
[list $ctext tag conf hunksep -foreground]]
10148
10165
grid x $top .hunksepbut $top .hunksep -sticky w
10149
10166
label $top .markbgsep -padx 40 -relief sunk -background $markbgcolor
@@ -10154,7 +10171,7 @@ proc doprefs {} {
10154
10171
grid x $top .markbgbut $top .markbgsep -sticky w
10155
10172
label $top .selbgsep -padx 40 -relief sunk -background $selectbgcolor
10156
10173
button $top .selbgbut -text [mc " Select bg" ] -font optionfont \
10157
- -command [list choosecolor selectbgcolor {} $top .selbgsep background setselbg]
10174
+ -command [list choosecolor selectbgcolor {} $top .selbgsep [mc " background" ] setselbg]
10158
10175
grid x $top .selbgbut $top .selbgsep -sticky w
10159
10176
10160
10177
label $top .cfont -text [mc " Fonts: press to choose" ]
@@ -10897,4 +10914,9 @@ if {[info exists permviews]} {
10897
10914
addviewmenu $n
10898
10915
}
10899
10916
}
10917
+
10918
+ if {[tk windowingsystem] eq " win32" } {
10919
+ focus -force .
10920
+ }
10921
+
10900
10922
getcommits {}
0 commit comments