summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e11f123)
raw | patch | inline | side by side (parent: e11f123)
author | Paul Mackerras <paulus@samba.org> | |
Sat, 16 Jun 2007 11:21:57 +0000 (21:21 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sat, 23 Jun 2007 10:55:26 +0000 (20:55 +1000) |
With some large repositories, a commit can end up on thousands of
branches, which results in an extremely long "Branches:" line in the
details window, and that results in the window being extremely slow
to scroll.
This fixes it by just showing "many (N)" after "Branches:", "Follows:"
or "Precedes:", where N is the number of heads or tags. The limit
is currently set at 20 but could be made configurable (and the "many"
could be a link to pop up a window listing them all in case anyone
really wants to know).
Signed-off-by: Paul Mackerras <paulus@samba.org>
branches, which results in an extremely long "Branches:" line in the
details window, and that results in the window being extremely slow
to scroll.
This fixes it by just showing "many (N)" after "Branches:", "Follows:"
or "Precedes:", where N is the number of heads or tags. The limit
is currently set at 20 but could be made configurable (and the "many"
could be a link to pop up a window listing them all in case anyone
really wants to know).
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 5948ec37c5c08883ebfed88af53731fffea521e1..de5bae7a0e6e2603d0eaf15d9b3212934ea5fd56 100755 (executable)
--- a/gitk
+++ b/gitk
# add a list of tag or branch names at position pos
# returns the number of names inserted
proc appendrefs {pos ids var} {
- global ctext commitrow linknum curview $var
+ global ctext commitrow linknum curview $var maxrefs
if {[catch {$ctext index $pos}]} {
return 0
lappend tags [list $tag $id]
}
}
- 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
- if {[info exists commitrow($curview,$id)]} {
- $ctext tag conf $lk -foreground blue
- $ctext tag bind $lk <1> \
- [list selectline $commitrow($curview,$id) 1]
- $ctext tag conf $lk -underline 1
- $ctext tag bind $lk <Enter> { %W configure -cursor hand2 }
- $ctext tag bind $lk <Leave> { %W configure -cursor $curtextcursor }
+ if {[llength $tags] > $maxrefs} {
+ $ctext insert $pos "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
+ if {[info exists commitrow($curview,$id)]} {
+ $ctext tag conf $lk -foreground blue
+ $ctext tag bind $lk <1> \
+ [list selectline $commitrow($curview,$id) 1]
+ $ctext tag conf $lk -underline 1
+ $ctext tag bind $lk <Enter> { %W configure -cursor hand2 }
+ $ctext tag bind $lk <Leave> \
+ { %W configure -cursor $curtextcursor }
+ }
+ set sep ", "
}
- set sep ", "
}
$ctext conf -state disabled
return [llength $tags]
set cmitmode "patch"
set wrapcomment "none"
set showneartags 1
+set maxrefs 20
set colors {green red blue magenta darkgrey brown orange}
set bgcolor white