[00/14] upload-pack: use 'struct upload_pack_data' thoroughly, part 3
mbox series

Message ID 20200611120518.10771-1-chriscool@tuxfamily.org
Headers show
Series
  • upload-pack: use 'struct upload_pack_data' thoroughly, part 3
Related show

Message

Christian Couder June 11, 2020, 12:05 p.m. UTC
This patch series is the third and last part of an effort to move all
static variables in 'upload-pack.c' into 'struct upload_pack_data'.

It is based on 'cc/upload-pack-data-2' which contains "part 2" of this
effort.

There are no static variables left in 'upload-pack.c' after this patch
series. Patch 14/14 is a small refactoring on top which can be left
out.

Thanks to Peff, Jonathan Tan and Stolee who reviewed previous parts of
this.

Christian Couder (14):
  upload-pack: pass upload_pack_data to send_shallow_list()
  upload-pack: pass upload_pack_data to deepen()
  upload-pack: pass upload_pack_data to deepen_by_rev_list()
  upload-pack: pass upload_pack_data to send_unshallow()
  upload-pack: move shallow_nr to upload_pack_data
  upload-pack: move extra_edge_obj to upload_pack_data
  upload-pack: move allow_unadvertised_object_request to
    upload_pack_data
  upload-pack: change allow_unadvertised_object_request to an enum
  upload-pack: pass upload_pack_data to process_haves()
  upload-pack: pass upload_pack_data to send_acks()
  upload-pack: pass upload_pack_data to ok_to_give_up()
  upload-pack: pass upload_pack_data to got_oid()
  upload-pack: move oldest_have to upload_pack_data
  upload-pack: refactor common code into do_got_oid()

 upload-pack.c | 287 ++++++++++++++++++++++----------------------------
 1 file changed, 125 insertions(+), 162 deletions(-)

Comments

Jonathan Tan June 11, 2020, 8:04 p.m. UTC | #1
> This patch series is the third and last part of an effort to move all
> static variables in 'upload-pack.c' into 'struct upload_pack_data'.
> 
> It is based on 'cc/upload-pack-data-2' which contains "part 2" of this
> effort.
> 
> There are no static variables left in 'upload-pack.c' after this patch
> series. Patch 14/14 is a small refactoring on top which can be left
> out.

Thanks. Overall, I see that this patch set gives "struct
upload_pack_data" to functions that use global variables (and in doing
so, shrinks their parameter list), enabling global variables to be moved
into that struct with a small diff. The changes are generally
mechanical, and this patch set looks good to me.

As an aside, I have attempted rebasing my CDN offloading patches [1]
from cc/upload-pack-data-2 onto this series, and the rebase succeeds
with trivial work needed.

[1] https://lore.kernel.org/git/cover.1591821067.git.jonathantanmy@google.com/