send-pack: track errors for each ref

Instead of keeping the 'ret' variable, we instead have a
status flag for each ref that tracks what happened to it.
We then print the ref status after all of the refs have
been examined.

This paves the way for three improvements:
  - updating tracking refs only for non-error refs
  - incorporating remote rejection into the printed status
  - printing errors in a different order than we processed
    (e.g., consolidating non-ff errors near the end with
    a special message)

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