Thanks, Brandon and Junio, for your comments.
Updates since v2:
- nothing new in patches 1 and 2
- patch 3: now clear priority queue unconditionally once we are done
with it (as requested by Brandon in a comment for a later patch)
- patch 4: updated commit message to not mention everything_local() (as
pointed out by Brandon), updated test to not rely on the fact that
fetch-pack uses prefix matching (thanks, Junio, for the observation)
- patch 5: used a more descriptive name ("struct negotiation_state")
for the struct, instead of "struct data"
- squashed patch 8 into patch 7; this means that the comments are not
moved verbatim, but for the reviewer, verbatim-ness of comments is
probably not that important anyway
Jonathan Tan (7):
fetch-pack: split up everything_local()
fetch-pack: clear marks before re-marking
fetch-pack: directly end negotiation if ACK ready
fetch-pack: use ref adv. to prune "have" sent
fetch-pack: make negotiation-related vars local
fetch-pack: move common check and marking together
fetch-pack: introduce negotiator API
Makefile | 2 +
fetch-negotiator.c | 8 ++
fetch-negotiator.h | 57 ++++++++++
fetch-pack.c | 255 ++++++++++++++----------------------------
negotiator/default.c | 176 +++++++++++++++++++++++++++++
negotiator/default.h | 8 ++
object.h | 3 +-
t/t5500-fetch-pack.sh | 33 ++++++
8 files changed, 373 insertions(+), 169 deletions(-)
create mode 100644 fetch-negotiator.c
create mode 100644 fetch-negotiator.h
create mode 100644 negotiator/default.c
create mode 100644 negotiator/default.h
--
2.17.0.582.gccdcbd54c4