submodule: do not copy unknown update mode from .gitmodules

When submodule.$name.update is given as hint from the upstream in
the .gitmodules file, we used to blindly copy it to .git/config,
unless there already is a value defined for the submodule.

However, there is no reason to expect that the update mode hinted by
the upstream is available in the version of Git the user is using,
and a really custom "!cmd" prepared by an upstream person running on
Linux may not even be available to a user on Windows.  It is simply
irresponsible to copy the setting blindly and to attempt to use it
during a later "submodule update" without validating it first.

Just show the suggested value to the diagnostic output, and set the
value to 'none' in the configuration, if it is not one of the ones
that are known to be supported by this version of Git.

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