Skip to content

Commit d92aa57

Browse files
stefandtwpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 6e8fda5 commit d92aa57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ proc commitonrow {row} {
13151315

13161316
proc closevarcs {v} {
13171317
global varctok varccommits varcid parents children
1318-
global cmitlisted commitidx vtokmod
1318+
global cmitlisted commitidx vtokmod curview numcommits
13191319

13201320
set missing_parents 0
13211321
set scripts {}
@@ -1340,6 +1340,9 @@ proc closevarcs {v} {
13401340
}
13411341
lappend varccommits($v,$b) $p
13421342
incr commitidx($v)
1343+
if {$v == $curview} {
1344+
set numcommits $commitidx($v)
1345+
}
13431346
set scripts [check_interest $p $scripts]
13441347
}
13451348
}

0 commit comments

Comments
 (0)