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>
1 file changed
tree: a338acf5695bfac5b8d6728c2aa578d4d9737b03
  1. block-sha1/
  2. builtin/
  3. compat/
  4. contrib/
  5. Documentation/
  6. git-gui/
  7. git_remote_helpers/
  8. gitk-git/
  9. gitweb/
  10. mergetools/
  11. perl/
  12. po/
  13. ppc/
  14. t/
  15. templates/
  16. vcs-svn/
  17. xdiff/
  18. .gitattributes
  19. .gitignore
  20. .mailmap
  21. abspath.c
  22. aclocal.m4
  23. advice.c
  24. advice.h
  25. alias.c
  26. alloc.c
  27. archive-tar.c
  28. archive-zip.c
  29. archive.c
  30. archive.h
  31. argv-array.c
  32. argv-array.h
  33. attr.c
  34. attr.h
  35. base85.c
  36. bisect.c
  37. bisect.h
  38. blob.c
  39. blob.h
  40. branch.c
  41. branch.h
  42. builtin.h
  43. bulk-checkin.c
  44. bulk-checkin.h
  45. bundle.c
  46. bundle.h
  47. cache-tree.c
  48. cache-tree.h
  49. cache.h
  50. check-builtins.sh
  51. check-racy.c
  52. check_bindir
  53. color.c
  54. color.h
  55. column.c
  56. column.h
  57. combine-diff.c
  58. command-list.txt
  59. commit.c
  60. commit.h
  61. config.c
  62. config.mak.in
  63. config.mak.uname
  64. configure.ac
  65. connect.c
  66. connected.c
  67. connected.h
  68. convert.c
  69. convert.h
  70. copy.c
  71. COPYING
  72. credential-cache--daemon.c
  73. credential-cache.c
  74. credential-store.c
  75. credential.c
  76. credential.h
  77. csum-file.c
  78. csum-file.h
  79. ctype.c
  80. daemon.c
  81. date.c
  82. decorate.c
  83. decorate.h
  84. delta.h
  85. diff-delta.c
  86. diff-lib.c
  87. diff-no-index.c
  88. diff.c
  89. diff.h
  90. diffcore-break.c
  91. diffcore-delta.c
  92. diffcore-order.c
  93. diffcore-pickaxe.c
  94. diffcore-rename.c
  95. diffcore.h
  96. dir.c
  97. dir.h
  98. editor.c
  99. entry.c
  100. environment.c
  101. exec_cmd.c
  102. exec_cmd.h
  103. fast-import.c
  104. fetch-pack.c
  105. fetch-pack.h
  106. fixup-builtins
  107. fmt-merge-msg.h
  108. fsck.c
  109. fsck.h
  110. generate-cmdlist.sh
  111. gettext.c
  112. gettext.h
  113. git-add--interactive.perl
  114. git-am.sh
  115. git-archimport.perl
  116. git-bisect.sh
  117. git-compat-util.h
  118. git-cvsexportcommit.perl
  119. git-cvsimport.perl
  120. git-cvsserver.perl
  121. git-difftool--helper.sh
  122. git-difftool.perl
  123. git-filter-branch.sh
  124. git-instaweb.sh
  125. git-lost-found.sh
  126. git-merge-octopus.sh
  127. git-merge-one-file.sh
  128. git-merge-resolve.sh
  129. git-mergetool--lib.sh
  130. git-mergetool.sh
  131. git-p4.py
  132. git-parse-remote.sh
  133. git-pull.sh
  134. git-quiltimport.sh
  135. git-rebase--am.sh
  136. git-rebase--interactive.sh
  137. git-rebase--merge.sh
  138. git-rebase.sh
  139. git-relink.perl
  140. git-remote-testgit
  141. git-remote-testpy.py
  142. git-repack.sh
  143. git-request-pull.sh
  144. git-send-email.perl
  145. git-sh-i18n.sh
  146. git-sh-setup.sh
  147. git-stash.sh
  148. git-submodule.sh
  149. git-svn.perl
  150. GIT-VERSION-GEN
  151. git-web--browse.sh
  152. git.c
  153. git.spec.in
  154. gpg-interface.c
  155. gpg-interface.h
  156. graph.c
  157. graph.h
  158. grep.c
  159. grep.h
  160. hash.c
  161. hash.h
  162. help.c
  163. help.h
  164. hex.c
  165. http-backend.c
  166. http-fetch.c
  167. http-push.c
  168. http-walker.c
  169. http.c
  170. http.h
  171. ident.c
  172. imap-send.c
  173. INSTALL
  174. kwset.c
  175. kwset.h
  176. levenshtein.c
  177. levenshtein.h
  178. LGPL-2.1
  179. line-log.c
  180. line-log.h
  181. line-range.c
  182. line-range.h
  183. list-objects.c
  184. list-objects.h
  185. ll-merge.c
  186. ll-merge.h
  187. lockfile.c
  188. log-tree.c
  189. log-tree.h
  190. mailmap.c
  191. mailmap.h
  192. Makefile
  193. match-trees.c
  194. merge-blobs.c
  195. merge-blobs.h
  196. merge-recursive.c
  197. merge-recursive.h
  198. merge.c
  199. mergesort.c
  200. mergesort.h
  201. name-hash.c
  202. notes-cache.c
  203. notes-cache.h
  204. notes-merge.c
  205. notes-merge.h
  206. notes.c
  207. notes.h
  208. object.c
  209. object.h
  210. pack-check.c
  211. pack-refs.c
  212. pack-refs.h
  213. pack-revindex.c
  214. pack-revindex.h
  215. pack-write.c
  216. pack.h
  217. pager.c
  218. parse-options-cb.c
  219. parse-options.c
  220. parse-options.h
  221. patch-delta.c
  222. patch-ids.c
  223. patch-ids.h
  224. path.c
  225. pathspec.c
  226. pathspec.h
  227. pkt-line.c
  228. pkt-line.h
  229. preload-index.c
  230. pretty.c
  231. progress.c
  232. progress.h
  233. prompt.c
  234. prompt.h
  235. quote.c
  236. quote.h
  237. reachable.c
  238. reachable.h
  239. read-cache.c
  240. README
  241. reflog-walk.c
  242. reflog-walk.h
  243. refs.c
  244. refs.h
  245. remote-curl.c
  246. remote-testsvn.c
  247. remote.c
  248. remote.h
  249. replace_object.c
  250. rerere.c
  251. rerere.h
  252. resolve-undo.c
  253. resolve-undo.h
  254. revision.c
  255. revision.h
  256. run-command.c
  257. run-command.h
  258. send-pack.c
  259. send-pack.h
  260. sequencer.c
  261. sequencer.h
  262. server-info.c
  263. setup.c
  264. sh-i18n--envsubst.c
  265. sha1-array.c
  266. sha1-array.h
  267. sha1-lookup.c
  268. sha1-lookup.h
  269. sha1_file.c
  270. sha1_name.c
  271. shallow.c
  272. shell.c
  273. shortlog.h
  274. show-index.c
  275. sideband.c
  276. sideband.h
  277. sigchain.c
  278. sigchain.h
  279. strbuf.c
  280. strbuf.h
  281. streaming.c
  282. streaming.h
  283. string-list.c
  284. string-list.h
  285. submodule.c
  286. submodule.h
  287. symlinks.c
  288. tag.c
  289. tag.h
  290. tar.h
  291. test-chmtime.c
  292. test-ctype.c
  293. test-date.c
  294. test-delta.c
  295. test-dump-cache-tree.c
  296. test-genrandom.c
  297. test-index-version.c
  298. test-line-buffer.c
  299. test-match-trees.c
  300. test-mergesort.c
  301. test-mktemp.c
  302. test-parse-options.c
  303. test-path-utils.c
  304. test-regex.c
  305. test-revision-walking.c
  306. test-run-command.c
  307. test-scrap-cache-tree.c
  308. test-sha1.c
  309. test-sha1.sh
  310. test-sigchain.c
  311. test-string-list.c
  312. test-subprocess.c
  313. test-svn-fe.c
  314. test-wildmatch.c
  315. thread-utils.c
  316. thread-utils.h
  317. trace.c
  318. transport-helper.c
  319. transport.c
  320. transport.h
  321. tree-diff.c
  322. tree-walk.c
  323. tree-walk.h
  324. tree.c
  325. tree.h
  326. unimplemented.sh
  327. unix-socket.c
  328. unix-socket.h
  329. unpack-trees.c
  330. unpack-trees.h
  331. upload-pack.c
  332. url.c
  333. url.h
  334. usage.c
  335. userdiff.c
  336. userdiff.h
  337. utf8.c
  338. utf8.h
  339. varint.c
  340. varint.h
  341. version.c
  342. version.h
  343. walker.c
  344. walker.h
  345. wildmatch.c
  346. wildmatch.h
  347. wrap-for-bin.sh
  348. wrapper.c
  349. write_or_die.c
  350. ws.c
  351. wt-status.c
  352. wt-status.h
  353. xdiff-interface.c
  354. xdiff-interface.h
  355. zlib.c