Code

gitk: Use git log without --topo-order and reorganize the commits ourselves
authorPaul Mackerras <paulus@samba.org>
Sun, 2 Dec 2007 23:33:01 +0000 (10:33 +1100)
committerPaul Mackerras <paulus@samba.org>
Sun, 2 Dec 2007 23:33:01 +0000 (10:33 +1100)
commit7fcc92bff4f75b69d61d8d32a5326395c20ff587
tree472706738cf4fa37876f002b713a2ddf6cb8a3f6
parent7388bcbc5431552718dde5c3259d861d2fa75a12
gitk: Use git log without --topo-order and reorganize the commits ourselves

This very large patch implements code to organize the commits from
git log into "arcs" (sequences of commits where each pair of adjacent
commits are the only parent and child of each other), and orders the
arcs so as to get a topological ordering of the commits.  This means
we can use git log without --topo-order and display the commits as we
get them, incrementally, which makes the cold-cache start up time much
faster, particularly on unpacked repos.

One beneficial effect of this is that the File->Update menu item now
just adds any new commits to the existing graph instead of rereading
the whole thing from scratch, which is much faster.  (If you do want
to reread the whole graph from scratch you can use File->Reload.)

At an implementation level, this means that the displayorder and
parentlist lists are no longer fully valid at all times, and the
commitrow array has gone.  New procedures commitinview and commitonrow
replace the commitrow array, and make_disporder ensures that
displayorder and parentlist are valid for a range of rows.

The overall time to load the kernel repository has gone up a bit, from
~9 seconds to ~11 seconds on my G5, but I think that is worth it given
that the time to get a window up with commits displayed in it has gone
from ~3 seconds to under 1 second.

Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk