diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-03 01:30:46 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-03 01:30:46 +0300 |
commit | 7c85ee6c5818f4409a29e40cc406ef5db9560af8 (patch) | |
tree | 3ae0b2267d235f9bf4f81dd1a7d781e980a953ce /fetch-pack.c | |
parent | d6873a396e054d814744f8943fd1c343ecf4a9dc (diff) | |
parent | 42cc7485a2ec49ecc440c921d2eb0cae4da80549 (diff) |
Merge branch 'jt/fetch-negotiator-skipping'
Add a server-side knob to skip commits in exponential/fibbonacci
stride in an attempt to cover wider swath of history with a smaller
number of iterations, potentially accepting a larger packfile
transfer, instead of going back one commit a time during common
ancestor discovery during the "git fetch" transaction.
* jt/fetch-negotiator-skipping:
negotiator/skipping: skip commits during fetch
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index 0a9d184adb..5714bcbddd 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -35,6 +35,7 @@ static int agent_supported; static int server_supports_filtering; static struct lock_file shallow_lock; static const char *alternate_shallow_file; +static char *negotiation_algorithm; /* Remember to update object flag allocation in object.h */ #define COMPLETE (1U << 0) @@ -913,7 +914,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args, const char *agent_feature; int agent_len; struct fetch_negotiator negotiator; - fetch_negotiator_init(&negotiator); + fetch_negotiator_init(&negotiator, negotiation_algorithm); sort_ref_list(&ref, ref_compare_name); QSORT(sought, nr_sought, cmp_ref_by_name); @@ -1324,7 +1325,7 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args, int in_vain = 0; int haves_to_send = INITIAL_FLUSH; struct fetch_negotiator negotiator; - fetch_negotiator_init(&negotiator); + fetch_negotiator_init(&negotiator, negotiation_algorithm); packet_reader_init(&reader, fd[0], NULL, 0, PACKET_READ_CHOMP_NEWLINE); @@ -1406,6 +1407,8 @@ static void fetch_pack_config(void) git_config_get_bool("repack.usedeltabaseoffset", &prefer_ofs_delta); git_config_get_bool("fetch.fsckobjects", &fetch_fsck_objects); git_config_get_bool("transfer.fsckobjects", &transfer_fsck_objects); + git_config_get_string("fetch.negotiationalgorithm", + &negotiation_algorithm); git_config(git_default_config, NULL); } |