From 3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Mon, 2 Jul 2018 15:39:44 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- transport.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'transport.h') diff --git a/transport.h b/transport.h index 7792b08582..d31be5be63 100644 --- a/transport.h +++ b/transport.h @@ -25,6 +25,16 @@ struct git_transport_options { const char *receivepack; struct push_cas_option *cas; struct list_objects_filter_options filter_options; + + /* + * This is only used during fetch. See the documentation of + * negotiation_tips in struct fetch_pack_args. + * + * This field is only supported by transports that support connect or + * stateless_connect. Set this field directly instead of using + * transport_set_option(). + */ + struct oid_array *negotiation_tips; }; enum transport_family { -- cgit v1.2.3