@@ -288,7 +288,7 @@ proc parseviewrevs {view revs} {
288
288
if {$sdm != 2} {
289
289
lappend ret $id
290
290
} else {
291
- lset ret end [lindex $ret end]... $id
291
+ lset ret end $id ... [lindex $ret end]
292
292
}
293
293
lappend pos $id
294
294
}
@@ -1677,6 +1677,7 @@ proc readrefs {} {
1677
1677
global tagids idtags headids idheads tagobjid
1678
1678
global otherrefids idotherrefs mainhead mainheadid
1679
1679
global selecthead selectheadid
1680
+ global hideremotes
1680
1681
1681
1682
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
1682
1683
catch {unset $v }
@@ -1689,7 +1690,7 @@ proc readrefs {} {
1689
1690
if {![string match " refs/*" $ref ]} continue
1690
1691
set name [string range $ref 5 end]
1691
1692
if {[string match " remotes/*" $name ]} {
1692
- if {![string match " */HEAD" $name ]} {
1693
+ if {![string match " */HEAD" $name ] && ! $hideremotes } {
1693
1694
set headids($name ) $id
1694
1695
lappend idheads($id ) $name
1695
1696
}
@@ -2520,6 +2521,7 @@ proc savestuff {w} {
2520
2521
global cmitmode wrapcomment datetimeformat limitdiffs
2521
2522
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
2522
2523
global autoselect extdifftool perfile_attrs markbgcolor
2524
+ global hideremotes
2523
2525
2524
2526
if {$stuffsaved } return
2525
2527
if {![winfo viewable .]} return
@@ -2539,6 +2541,7 @@ proc savestuff {w} {
2539
2541
puts $f [list set wrapcomment $wrapcomment ]
2540
2542
puts $f [list set autoselect $autoselect ]
2541
2543
puts $f [list set showneartags $showneartags ]
2544
+ puts $f [list set hideremotes $hideremotes ]
2542
2545
puts $f [list set showlocalchanges $showlocalchanges ]
2543
2546
puts $f [list set datetimeformat $datetimeformat ]
2544
2547
puts $f [list set limitdiffs $limitdiffs ]
@@ -7906,6 +7909,11 @@ proc gotocommit {} {
7906
7909
}
7907
7910
set id [lindex $matches 0]
7908
7911
}
7912
+ } else {
7913
+ if {[catch {set id [exec git rev-parse --verify $sha1string ]}]} {
7914
+ error_popup [mc " Revision %s is not known" $sha1string ]
7915
+ return
7916
+ }
7909
7917
}
7910
7918
}
7911
7919
if {[commitinview $id $curview ]} {
@@ -7915,7 +7923,7 @@ proc gotocommit {} {
7915
7923
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string ]} {
7916
7924
set msg [mc " SHA1 id %s is not known" $sha1string ]
7917
7925
} else {
7918
- set msg [mc " Tag/Head %s is not known " $sha1string ]
7926
+ set msg [mc " Revision %s is not in the current view " $sha1string ]
7919
7927
}
7920
7928
error_popup $msg
7921
7929
}
@@ -10383,6 +10391,7 @@ proc doprefs {} {
10383
10391
global oldprefs prefstop showneartags showlocalchanges
10384
10392
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
10385
10393
global tabstop limitdiffs autoselect extdifftool perfile_attrs
10394
+ global hideremotes
10386
10395
10387
10396
set top .gitkprefs
10388
10397
set prefstop $top
@@ -10391,7 +10400,7 @@ proc doprefs {} {
10391
10400
return
10392
10401
}
10393
10402
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
10394
- limitdiffs tabstop perfile_attrs} {
10403
+ limitdiffs tabstop perfile_attrs hideremotes } {
10395
10404
set oldprefs($v ) [set $v ]
10396
10405
}
10397
10406
toplevel $top
@@ -10423,6 +10432,9 @@ proc doprefs {} {
10423
10432
checkbutton $top .ntag -text [mc " Display nearby tags" ] \
10424
10433
-font optionfont -variable showneartags
10425
10434
grid x $top .ntag -sticky w
10435
+ checkbutton $top .hideremotes -text [mc " Hide remote refs" ] \
10436
+ -font optionfont -variable hideremotes
10437
+ grid x $top .hideremotes -sticky w
10426
10438
checkbutton $top .ldiff -text [mc " Limit diffs to listed paths" ] \
10427
10439
-font optionfont -variable limitdiffs
10428
10440
grid x $top .ldiff -sticky w
@@ -10547,7 +10559,7 @@ proc prefscan {} {
10547
10559
global oldprefs prefstop
10548
10560
10549
10561
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
10550
- limitdiffs tabstop perfile_attrs} {
10562
+ limitdiffs tabstop perfile_attrs hideremotes } {
10551
10563
global $v
10552
10564
set $v $oldprefs($v)
10553
10565
}
@@ -10561,6 +10573,7 @@ proc prefsok {} {
10561
10573
global oldprefs prefstop showneartags showlocalchanges
10562
10574
global fontpref mainfont textfont uifont
10563
10575
global limitdiffs treediffs perfile_attrs
10576
+ global hideremotes
10564
10577
10565
10578
catch {destroy $prefstop }
10566
10579
unset prefstop
@@ -10606,6 +10619,9 @@ proc prefsok {} {
10606
10619
$limitdiffs != $oldprefs(limitdiffs) } {
10607
10620
reselectline
10608
10621
}
10622
+ if {$hideremotes != $oldprefs(hideremotes) } {
10623
+ rereadrefs
10624
+ }
10609
10625
}
10610
10626
10611
10627
proc formatdate {d} {
@@ -10901,7 +10917,7 @@ proc gitattr {path attr default} {
10901
10917
} else {
10902
10918
set r " unspecified"
10903
10919
if {![catch {set line [exec git check-attr $attr -- $path ]}]} {
10904
- regexp "(.*): encoding : (.*)" $line m f r
10920
+ regexp "(.*): $attr : (.*)" $line m f r
10905
10921
}
10906
10922
set path_attr_cache($attr ,$path ) $r
10907
10923
}
@@ -10929,7 +10945,7 @@ proc cache_gitattr {attr pathlist} {
10929
10945
set newlist [lrange $newlist $lim end]
10930
10946
if {![catch {set rlist [eval exec git check-attr $attr -- $head ]}]} {
10931
10947
foreach row [split $rlist " \n " ] {
10932
- if {[regexp "(.*): encoding : (.*)" $row m path value]} {
10948
+ if {[regexp "(.*): $attr : (.*)" $row m path value]} {
10933
10949
if {[string index $path 0] eq " \" " } {
10934
10950
set path [encoding convertfrom [lindex $path 0]]
10935
10951
}
@@ -11011,6 +11027,7 @@ set mingaplen 100
11011
11027
set cmitmode " patch"
11012
11028
set wrapcomment " none"
11013
11029
set showneartags 1
11030
+ set hideremotes 0
11014
11031
set maxrefs 20
11015
11032
set maxlinelen 200
11016
11033
set showlocalchanges 1
0 commit comments