fetch-pack: support negotiation tip whitelist

During negotiation, fetch-pack eventually reports as "have" lines all
commits reachable from all refs. Allow the user to restrict the commits
sent in this way by providing a whitelist of tips; only the tips
themselves and their ancestors will be sent.

Both globs and single objects are supported.

This feature is only supported for protocols that support connect or
stateless-connect (such as HTTP with protocol v2).

This will speed up negotiation when the repository has multiple
relatively independent branches (for example, when a repository
interacts with multiple repositories, such as with linux-next [1] and
torvalds/linux [2]), and the user knows which local branch is likely to
have commits in common with the upstream branch they are fetching.

[1] https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/
[2] https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 files changed
tree: 6d3b797117769e6c5a60d9fcd0b30bc7479d20f1
  1. .github/
  2. block-sha1/
  3. builtin/
  4. ci/
  5. compat/
  6. contrib/
  7. Documentation/
  8. ewah/
  9. git-gui/
  10. gitk-git/
  11. gitweb/
  12. mergetools/
  13. negotiator/
  14. perl/
  15. po/
  16. ppc/
  17. refs/
  18. sha1dc/
  19. t/
  20. templates/
  21. vcs-svn/
  22. xdiff/
  23. .clang-format
  24. .gitattributes
  25. .gitignore
  26. .gitmodules
  27. .mailmap
  28. .travis.yml
  29. .tsan-suppressions
  30. abspath.c
  31. aclocal.m4
  32. advice.c
  33. advice.h
  34. alias.c
  35. alias.h
  36. alloc.c
  37. apply.c
  38. apply.h
  39. archive-tar.c
  40. archive-zip.c
  41. archive.c
  42. archive.h
  43. argv-array.c
  44. argv-array.h
  45. attr.c
  46. attr.h
  47. base85.c
  48. bisect.c
  49. bisect.h
  50. blame.c
  51. blame.h
  52. blob.c
  53. blob.h
  54. branch.c
  55. branch.h
  56. builtin.h
  57. bulk-checkin.c
  58. bulk-checkin.h
  59. bundle.c
  60. bundle.h
  61. cache-tree.c
  62. cache-tree.h
  63. cache.h
  64. chdir-notify.c
  65. chdir-notify.h
  66. check-builtins.sh
  67. check-racy.c
  68. check_bindir
  69. checkout.c
  70. checkout.h
  71. color.c
  72. color.h
  73. column.c
  74. column.h
  75. combine-diff.c
  76. command-list.txt
  77. commit-graph.c
  78. commit-graph.h
  79. commit-slab.h
  80. commit.c
  81. commit.h
  82. common-main.c
  83. config.c
  84. config.h
  85. config.mak.dev
  86. config.mak.in
  87. config.mak.uname
  88. configure.ac
  89. connect.c
  90. connect.h
  91. connected.c
  92. connected.h
  93. convert.c
  94. convert.h
  95. copy.c
  96. COPYING
  97. credential-cache--daemon.c
  98. credential-cache.c
  99. credential-store.c
  100. credential.c
  101. credential.h
  102. csum-file.c
  103. csum-file.h
  104. ctype.c
  105. daemon.c
  106. date.c
  107. decorate.c
  108. decorate.h
  109. delta.h
  110. detect-compiler
  111. diff-delta.c
  112. diff-lib.c
  113. diff-no-index.c
  114. diff.c
  115. diff.h
  116. diffcore-break.c
  117. diffcore-delta.c
  118. diffcore-order.c
  119. diffcore-pickaxe.c
  120. diffcore-rename.c
  121. diffcore.h
  122. dir-iterator.c
  123. dir-iterator.h
  124. dir.c
  125. dir.h
  126. editor.c
  127. entry.c
  128. environment.c
  129. exec-cmd.c
  130. exec-cmd.h
  131. fast-import.c
  132. fetch-negotiator.c
  133. fetch-negotiator.h
  134. fetch-object.c
  135. fetch-object.h
  136. fetch-pack.c
  137. fetch-pack.h
  138. fmt-merge-msg.h
  139. fsck.c
  140. fsck.h
  141. fsmonitor.c
  142. fsmonitor.h
  143. generate-cmdlist.sh
  144. gettext.c
  145. gettext.h
  146. git-add--interactive.perl
  147. git-archimport.perl
  148. git-bisect.sh
  149. git-compat-util.h
  150. git-cvsexportcommit.perl
  151. git-cvsimport.perl
  152. git-cvsserver.perl
  153. git-difftool--helper.sh
  154. git-filter-branch.sh
  155. git-instaweb.sh
  156. git-merge-octopus.sh
  157. git-merge-one-file.sh
  158. git-merge-resolve.sh
  159. git-mergetool--lib.sh
  160. git-mergetool.sh
  161. git-p4.py
  162. git-parse-remote.sh
  163. git-quiltimport.sh
  164. git-rebase--am.sh
  165. git-rebase--interactive.sh
  166. git-rebase--merge.sh
  167. git-rebase.sh
  168. git-remote-testgit.sh
  169. git-request-pull.sh
  170. git-send-email.perl
  171. git-sh-i18n.sh
  172. git-sh-setup.sh
  173. git-stash.sh
  174. git-submodule.sh
  175. git-svn.perl
  176. GIT-VERSION-GEN
  177. git-web--browse.sh
  178. git.c
  179. git.rc
  180. gpg-interface.c
  181. gpg-interface.h
  182. graph.c
  183. graph.h
  184. grep.c
  185. grep.h
  186. hash.h
  187. hashmap.c
  188. hashmap.h
  189. help.c
  190. help.h
  191. hex.c
  192. http-backend.c
  193. http-fetch.c
  194. http-push.c
  195. http-walker.c
  196. http.c
  197. http.h
  198. ident.c
  199. imap-send.c
  200. INSTALL
  201. iterator.h
  202. khash.h
  203. kwset.c
  204. kwset.h
  205. levenshtein.c
  206. levenshtein.h
  207. LGPL-2.1
  208. line-log.c
  209. line-log.h
  210. line-range.c
  211. line-range.h
  212. list-objects-filter-options.c
  213. list-objects-filter-options.h
  214. list-objects-filter.c
  215. list-objects-filter.h
  216. list-objects.c
  217. list-objects.h
  218. list.h
  219. ll-merge.c
  220. ll-merge.h
  221. lockfile.c
  222. lockfile.h
  223. log-tree.c
  224. log-tree.h
  225. ls-refs.c
  226. ls-refs.h
  227. mailinfo.c
  228. mailinfo.h
  229. mailmap.c
  230. mailmap.h
  231. Makefile
  232. match-trees.c
  233. mem-pool.c
  234. mem-pool.h
  235. merge-blobs.c
  236. merge-blobs.h
  237. merge-recursive.c
  238. merge-recursive.h
  239. merge.c
  240. mergesort.c
  241. mergesort.h
  242. name-hash.c
  243. notes-cache.c
  244. notes-cache.h
  245. notes-merge.c
  246. notes-merge.h
  247. notes-utils.c
  248. notes-utils.h
  249. notes.c
  250. notes.h
  251. object-store.h
  252. object.c
  253. object.h
  254. oidmap.c
  255. oidmap.h
  256. oidset.c
  257. oidset.h
  258. pack-bitmap-write.c
  259. pack-bitmap.c
  260. pack-bitmap.h
  261. pack-check.c
  262. pack-objects.c
  263. pack-objects.h
  264. pack-revindex.c
  265. pack-revindex.h
  266. pack-write.c
  267. pack.h
  268. packfile.c
  269. packfile.h
  270. pager.c
  271. parse-options-cb.c
  272. parse-options.c
  273. parse-options.h
  274. patch-delta.c
  275. patch-ids.c
  276. patch-ids.h
  277. path.c
  278. path.h
  279. pathspec.c
  280. pathspec.h
  281. pkt-line.c
  282. pkt-line.h
  283. preload-index.c
  284. pretty.c
  285. pretty.h
  286. prio-queue.c
  287. prio-queue.h
  288. progress.c
  289. progress.h
  290. prompt.c
  291. prompt.h
  292. protocol.c
  293. protocol.h
  294. quote.c
  295. quote.h
  296. reachable.c
  297. reachable.h
  298. read-cache.c
  299. README.md
  300. ref-filter.c
  301. ref-filter.h
  302. reflog-walk.c
  303. reflog-walk.h
  304. refs.c
  305. refs.h
  306. refspec.c
  307. refspec.h
  308. remote-curl.c
  309. remote-testsvn.c
  310. remote.c
  311. remote.h
  312. replace-object.c
  313. replace-object.h
  314. repository.c
  315. repository.h
  316. rerere.c
  317. rerere.h
  318. resolve-undo.c
  319. resolve-undo.h
  320. revision.c
  321. revision.h
  322. run-command.c
  323. run-command.h
  324. send-pack.c
  325. send-pack.h
  326. sequencer.c
  327. sequencer.h
  328. serve.c
  329. serve.h
  330. server-info.c
  331. setup.c
  332. sh-i18n--envsubst.c
  333. sha1-array.c
  334. sha1-array.h
  335. sha1-file.c
  336. sha1-lookup.c
  337. sha1-lookup.h
  338. sha1-name.c
  339. sha1dc_git.c
  340. sha1dc_git.h
  341. shallow.c
  342. shell.c
  343. shortlog.h
  344. show-index.c
  345. sideband.c
  346. sideband.h
  347. sigchain.c
  348. sigchain.h
  349. split-index.c
  350. split-index.h
  351. strbuf.c
  352. strbuf.h
  353. streaming.c
  354. streaming.h
  355. string-list.c
  356. string-list.h
  357. sub-process.c
  358. sub-process.h
  359. submodule-config.c
  360. submodule-config.h
  361. submodule.c
  362. submodule.h
  363. symlinks.c
  364. tag.c
  365. tag.h
  366. tar.h
  367. tempfile.c
  368. tempfile.h
  369. thread-utils.c
  370. thread-utils.h
  371. tmp-objdir.c
  372. tmp-objdir.h
  373. trace.c
  374. trace.h
  375. trailer.c
  376. trailer.h
  377. transport-helper.c
  378. transport-internal.h
  379. transport.c
  380. transport.h
  381. tree-diff.c
  382. tree-walk.c
  383. tree-walk.h
  384. tree.c
  385. tree.h
  386. unicode-width.h
  387. unimplemented.sh
  388. unix-socket.c
  389. unix-socket.h
  390. unpack-trees.c
  391. unpack-trees.h
  392. upload-pack.c
  393. upload-pack.h
  394. url.c
  395. url.h
  396. urlmatch.c
  397. urlmatch.h
  398. usage.c
  399. userdiff.c
  400. userdiff.h
  401. utf8.c
  402. utf8.h
  403. varint.c
  404. varint.h
  405. version.c
  406. version.h
  407. versioncmp.c
  408. walker.c
  409. walker.h
  410. wildmatch.c
  411. wildmatch.h
  412. worktree.c
  413. worktree.h
  414. wrap-for-bin.sh
  415. wrapper.c
  416. write-or-die.c
  417. ws.c
  418. wt-status.c
  419. wt-status.h
  420. xdiff-interface.c
  421. xdiff-interface.h
  422. zlib.c
README.md

Git - fast, scalable, distributed revision control system

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git is an Open Source project covered by the GNU General Public License version 2 (some parts of it are under different licenses, compatible with the GPLv2). It was originally written by Linus Torvalds with help of a group of hackers around the net.

Please read the file INSTALL for installation instructions.

Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools.

See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname>.

CVS users may also want to read Documentation/gitcvs-migration.txt (man gitcvs-migration or git help cvs-migration if git is installed).

The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org (read Documentation/SubmittingPatches for instructions on patch submission). To subscribe to the list, send an email with just “subscribe git” in the body to majordomo@vger.kernel.org. The mailing list archives are available at https://public-inbox.org/git/, http://marc.info/?l=git and other archival sites.

Issues which are security relevant should be disclosed privately to the Git Security mailing list git-security@googlegroups.com.

The maintainer frequently sends the “What's cooking” reports that list the current status of various development topics to the mailing list. The discussion following them give a good reference for project status, development direction and remaining tasks.

The name “git” was given by Linus Torvalds when he wrote the very first version. He described the tool as “the stupid content tracker” and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of “get” may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • “global information tracker”: you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • “goddamn idiotic truckload of sh*t”: when it breaks