]> git.ipfire.org Git - thirdparty/git.git/commit - line-log.c
Speed up log -L... -M
authorThomas Rast <trast@student.ethz.ch>
Thu, 28 Mar 2013 16:47:34 +0000 (17:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Mar 2013 17:30:28 +0000 (10:30 -0700)
commit39410bf0bf81cb3f76fb9bfa8308cd672bc1442c
treea338acf5695bfac5b8d6728c2aa578d4d9737b03
parent13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0
Speed up log -L... -M

So far log -L only used the implicit diff filtering by pathspec.  If
the user specifies -M, we cannot do that, and so we simply handed the
whole diff queue (which is approximately 'git show --raw') to
diffcore_std().

Unfortunately this is very slow.  We can optimize a lot if we throw
out files that we know cannot possibly be interesting, in the same
spirit that the pathspec filtering reduces the number of files.

However, in this case, we have to be more careful.  Because we want to
look out for renames, we need to keep all filepairs where something
was deleted.

This is a bit hacky and should really be replaced by equivalent
support in --follow, and just using that.  However, in the meantime it
speeds up 'log -M -L' by an order of magnitude.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
line-log.c