Add git-archive

git-archive is a command to make TAR and ZIP archives of a git tree.
It helps prevent a proliferation of git-{format}-tree commands.

Instead of directly calling git-{tar,zip}-tree command, it defines
a very simple API, that archiver should implement and register in
"git-archive.c". This API is made up by 2 functions whose prototype
is defined in "archive.h" file.

 - The first one is used to parse 'extra' parameters which have
   signification only for the specific archiver. That would allow
   different archive backends to have different kind of options.

 - The second one is used to ask to an archive backend to build
   the archive given some already resolved parameters.

The main reason for making this API is to avoid using
git-{tar,zip}-tree commands, hence making them useless. Maybe it's
time for them to die ?

It also implements remote operations by defining a very simple
protocol: it first sends the name of the specific uploader followed
the repository name (git-upload-tar git://example.org/repo.git).
Then it sends options. It's done by sending a sequence of one
argument per packet, with prefix "argument ", followed by a flush.

The remote protocol is implemented in "git-archive.c" for client
side and is triggered by "--remote=<repo>" option. For example,
to fetch a TAR archive in a remote repo, you can issue:

$ git archive --format=tar --remote=git://xxx/yyy/zzz.git HEAD

We choose to not make a new command "git-fetch-archive" for example,
avoind one more GIT command which should be nice for users (less
commands to remember, keeps existing --remote option).

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