diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-01-31 14:29:15 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-31 17:57:48 +0100 |
commit | 4074d3c7e1a3b44c5c02235799d798f8b2613333 (patch) | |
tree | df8df4a1fc8a615c77f6ee63d429973f572f7cfc /bundle-uri.h | |
parent | bundle-uri: download in creationToken order (diff) | |
download | git-4074d3c7e1a3b44c5c02235799d798f8b2613333.tar.xz git-4074d3c7e1a3b44c5c02235799d798f8b2613333.zip |
clone: set fetch.bundleURI if appropriate
Bundle providers may organize their bundle lists in a way that is
intended to improve incremental fetches, not just initial clones.
However, they do need to state that they have organized with that in
mind, or else the client will not expect to save time by downloading
bundles after the initial clone. This is done by specifying a
bundle.heuristic value.
There are two types of bundle lists: those at a static URI and those
that are advertised from a Git remote over protocol v2.
The new fetch.bundleURI config value applies for static bundle URIs that
are not advertised over protocol v2. If the user specifies a static URI
via 'git clone --bundle-uri', then Git can set this config as a reminder
for future 'git fetch' operations to check the bundle list before
connecting to the remote(s).
For lists provided over protocol v2, we will want to take a different
approach and create a property of the remote itself by creating a
remote.<id>.* type config key. That is not implemented in this change.
Later changes will update 'git fetch' to consume this option.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle-uri.h')
-rw-r--r-- | bundle-uri.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bundle-uri.h b/bundle-uri.h index ef32840bfa..6dbc780f66 100644 --- a/bundle-uri.h +++ b/bundle-uri.h @@ -124,8 +124,14 @@ int bundle_uri_parse_config_format(const char *uri, * based on that information. * * Returns non-zero if no bundle information is found at the given 'uri'. + * + * If the pointer 'has_heuristic' is non-NULL, then the value it points to + * will be set to be non-zero if and only if the fetched list has a + * heuristic value. Such a value indicates that the list was designed for + * incremental fetches. */ -int fetch_bundle_uri(struct repository *r, const char *uri); +int fetch_bundle_uri(struct repository *r, const char *uri, + int *has_heuristic); /** * Given a bundle list that was already advertised (likely by the |