Support gitlinks in fast-import.

Currently fast-import/export cannot be used for
repositories with submodules. This patch extends
the relevant programs to make them correctly
process gitlinks.

Links can be represented by two forms of the
Modify command:

M 160000 SHA1 some/path

which sets the link target explicitly, or

M 160000 :mark some/path

where the mark refers to a commit. The latter
form can be used by importing tools to build
all submodules simultaneously in one physical
repository, and then simply fetch them apart.

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