gitk: Fix missing commits when using -S or -G

When -S or -G is used as a filter option, the resulting commit list rarely contains all matching commits. Only a certain number of commits are displayed and the rest are missing. "git log --boundary -S" does not return as many boundary commits as you might expect. gitk makes up for this in closevarcs() by adding missing parent (boundary) commits. However, it does not change $numcommits, which limits how many commits are shown. In the end, some commits at the end of the commit list are simply not shown. Change $numcommits whenever a missing parent is added to the current view. Signed-off-by: Stefan Dotterweich <stefandotterweich@gmx.de> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

Stefan Dotterweich committed Jun 4, 2016 at 10:47 UTC d92aa57039cf2e4acae6aedfe4a4d6bf39562763
1 file changed +4 -1
gitk
+4 -1
@@ -1315,7 +1315,7 @@ proc commitonrow {row} {
1315
1316 proc closevarcs {v} {
1317 global varctok varccommits varcid parents children
1318 - global cmitlisted commitidx vtokmod
1318 + global cmitlisted commitidx vtokmod curview numcommits
1319
1320 set missing_parents 0
1321 set scripts {}
@@ -1340,6 +1340,9 @@ proc closevarcs {v} {
1340 }
1341 lappend varccommits($v,$b) $p
1342 incr commitidx($v)
1343 + if {$v == $curview} {
1344 + set numcommits $commitidx($v)
1345 + }
1346 set scripts [check_interest $p $scripts]
1347 }
1348 }