git builtin "push"

This adds a builtin "push" command, which is largely just a C'ification of
the "git-push.sh" script.

Now, the reason I did it as a built-in is partly because it's yet another
step on relying less on shell, but it's actually mostly because I've
wanted to be able to push to _multiple_ repositories, and the most obvious
and simplest interface for that would seem be to just have a "remotes"
file that has multiple URL entries.

(For "pull", having multiple entries should either just select the first
one, or you could fall back on the others on failure - your choice).

And quite frankly, it just became too damn messy to do that in shell.
Besides, we actually have a fair amount of infrastructure in C, so it just
wasn't that hard to do.

Of course, this is almost totally untested. It probably doesn't work for
anything but the one trial I threw at it. "Simple" doesn't necessarily
mean "obviously correct".

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