Thin pack generation: optimization.

Jens Axboe noticed that recent "git push" has become very slow
since we made --thin transfer the default.

Thin pack generation to push a handful revisions that touch
relatively small number of paths out of huge tree was stupid; it
registered _everything_ from the excluded revisions.  As a
result, "Counting objects" phase was unnecessarily expensive.

This changes the logic to register the blobs and trees from
excluded revisions only for paths we are actually going to send
to the other end.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 file changed
tree: 78650a6645af528e687a1b86a26f7acae67771da
  1. arm/
  2. compat/
  3. contrib/
  4. Documentation/
  5. mozilla-sha1/
  6. ppc/
  7. t/
  8. templates/
  9. xdiff/
  10. .gitignore
  11. apply.c
  12. blame.c
  13. blob.c
  14. blob.h
  15. cache.h
  16. cat-file.c
  17. check-ref-format.c
  18. checkout-index.c
  19. clone-pack.c
  20. combine-diff.c
  21. commit-tree.c
  22. commit.c
  23. commit.h
  24. config.c
  25. connect.c
  26. convert-objects.c
  27. copy.c
  28. COPYING
  29. csum-file.c
  30. csum-file.h
  31. ctype.c
  32. daemon.c
  33. date.c
  34. delta.h
  35. describe.c
  36. diff-delta.c
  37. diff-files.c
  38. diff-index.c
  39. diff-stages.c
  40. diff-tree.c
  41. diff.c
  42. diff.h
  43. diffcore-break.c
  44. diffcore-delta.c
  45. diffcore-order.c
  46. diffcore-pathspec.c
  47. diffcore-pickaxe.c
  48. diffcore-rename.c
  49. diffcore.h
  50. entry.c
  51. environment.c
  52. exec_cmd.c
  53. exec_cmd.h
  54. fetch-clone.c
  55. fetch-pack.c
  56. fetch.c
  57. fetch.h
  58. fsck-objects.c
  59. generate-cmdlist.sh
  60. get-tar-commit-id.c
  61. git-add.sh
  62. git-am.sh
  63. git-annotate.perl
  64. git-applymbox.sh
  65. git-applypatch.sh
  66. git-archimport.perl
  67. git-bisect.sh
  68. git-branch.sh
  69. git-checkout.sh
  70. git-cherry.sh
  71. git-clean.sh
  72. git-clone.sh
  73. git-commit.sh
  74. git-compat-util.h
  75. git-count-objects.sh
  76. git-cvsexportcommit.perl
  77. git-cvsimport.perl
  78. git-cvsserver.perl
  79. git-diff.sh
  80. git-fetch.sh
  81. git-fmt-merge-msg.perl
  82. git-format-patch.sh
  83. git-grep.sh
  84. git-log.sh
  85. git-lost-found.sh
  86. git-ls-remote.sh
  87. git-merge-octopus.sh
  88. git-merge-one-file.sh
  89. git-merge-ours.sh
  90. git-merge-recursive.py
  91. git-merge-resolve.sh
  92. git-merge-stupid.sh
  93. git-merge.sh
  94. git-mv.perl
  95. git-parse-remote.sh
  96. git-prune.sh
  97. git-pull.sh
  98. git-push.sh
  99. git-rebase.sh
  100. git-relink.perl
  101. git-repack.sh
  102. git-request-pull.sh
  103. git-rerere.perl
  104. git-reset.sh
  105. git-resolve.sh
  106. git-revert.sh
  107. git-rm.sh
  108. git-send-email.perl
  109. git-sh-setup.sh
  110. git-shortlog.perl
  111. git-svnimport.perl
  112. git-tag.sh
  113. git-verify-tag.sh
  114. GIT-VERSION-GEN
  115. git-whatchanged.sh
  116. git.c
  117. git.spec.in
  118. gitk
  119. gitMergeCommon.py
  120. hash-object.c
  121. http-fetch.c
  122. http-push.c
  123. http.c
  124. http.h
  125. ident.c
  126. imap-send.c
  127. index-pack.c
  128. index.c
  129. init-db.c
  130. INSTALL
  131. local-fetch.c
  132. ls-files.c
  133. ls-tree.c
  134. mailinfo.c
  135. mailsplit.c
  136. Makefile
  137. merge-base.c
  138. merge-index.c
  139. merge-tree.c
  140. mktag.c
  141. mktree.c
  142. name-rev.c
  143. object.c
  144. object.h
  145. pack-check.c
  146. pack-objects.c
  147. pack-redundant.c
  148. pack.h
  149. pager.c
  150. patch-delta.c
  151. patch-id.c
  152. path.c
  153. peek-remote.c
  154. pkt-line.c
  155. pkt-line.h
  156. prune-packed.c
  157. quote.c
  158. quote.h
  159. read-cache.c
  160. read-tree.c
  161. README
  162. receive-pack.c
  163. refs.c
  164. refs.h
  165. repo-config.c
  166. rev-list.c
  167. rev-parse.c
  168. revision.c
  169. revision.h
  170. rsh.c
  171. rsh.h
  172. run-command.c
  173. run-command.h
  174. send-pack.c
  175. server-info.c
  176. setup.c
  177. sha1_file.c
  178. sha1_name.c
  179. shell.c
  180. show-branch.c
  181. show-index.c
  182. ssh-fetch.c
  183. ssh-pull.c
  184. ssh-push.c
  185. ssh-upload.c
  186. strbuf.c
  187. strbuf.h
  188. stripspace.c
  189. symbolic-ref.c
  190. tag.c
  191. tag.h
  192. tar-tree.c
  193. tar.h
  194. test-date.c
  195. test-delta.c
  196. tree-diff.c
  197. tree-walk.c
  198. tree-walk.h
  199. tree.c
  200. tree.h
  201. unpack-file.c
  202. unpack-objects.c
  203. update-index.c
  204. update-ref.c
  205. update-server-info.c
  206. upload-pack.c
  207. usage.c
  208. var.c
  209. verify-pack.c
  210. write-tree.c