slim down "git show-index"

As the documentation says, this is primarily for debugging, and
in the longer term we should rename it to test-show-index or something.

In the meantime, just avoid xmalloc (which slurps in the rest of git), and
separating out the trivial hex functions into "hex.o".

This results in

  [torvalds@nehalem git]$ size git-show-index
       text    data     bss     dec     hex filename
     222818    2276  112688  337782   52776 git-show-index (before)
       5696     624    1264    7584    1da0 git-show-index (after)

which is a whole lot better.

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