Code

gitk: Make updates go faster
authorPaul Mackerras <paulus@samba.org>
Fri, 9 May 2008 00:14:07 +0000 (10:14 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 9 May 2008 00:14:07 +0000 (10:14 +1000)
commitee66e089c1d4162765a3cec79fd5406e515b0db1
treeafdfc52c36d765c84ab5108db5da58b21726a5b6
parent3ed31a8120ec78c495206c89cf5d421d9198f847
gitk: Make updates go faster

This goes back to the method of doing updates where we translate the
revisions we're given to SHA1 ids and then remove the ones we've asked
for before or that we've already come across.  This speeds up updates
enormously in most cases since it means git log doesn't have to traverse
large parts of the tree.  We used to do this, but it had bugs, and commit
468bcaedbb1589f16955e63b6bfba01c2f53e433 (gitk: Don't filter view
arguments through git rev-parse) went to the slower method to avoid the
bugs.

In order to do this properly, we have to parse the command line and
understand all the flag arguments.  So this adds a parser that checks
all the flag arguments.  If there are any we don't know about, we
disable the optimization and just pass the whole lot to git log
(except for -d/--date-order, which we remove from the list).

With this we can then use git rev-parse on the non-flag arguments to
work out exactly what SHA1 ids are included and excluded in the list,
which then enables us to ask for just the new ones when updating.
One wrinkle is that we have to turn symmetric diff arguments (of the
form a...b) back into symmetric diff form so that --left-right still
works, as git rev parse turns a...b into a b ^merge_base(a,b).

This also updates a couple of copyright notices.

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