Re: [PATCH 00/13] upload-pack: use 'struct upload_pack_data' thoroughly, part 1
- From
Jeff King <peff@peff.net>
- Date
- May 15, 2020, 18:47 UTC
- Message-ID
- <20200515184716.GM3692649@coredump.intra.peff.net>
- In-Reply-To
- <20200515100454.14486-1-chriscool@tuxfamily.org>
On Fri, May 15, 2020 at 12:04:41PM +0200, Christian Couder wrote:
Show 16 quoted lines
> In the thread started by: > > https://lore.kernel.org/git/20200507095829.16894-1-chriscool@tuxfamily.org/ > > which led to the following bug fix commit: > > 08450ef791 (upload-pack: clear filter_options for each v2 fetch > command, 2020-05-08) > > it was agreed that having many static variables in 'upload-pack.c', > while upload_pack_v2() is called more than once per process, is very > bug prone and messy, and that a good way forward would be to use > 'struct upload_pack_data' thoroughly, especially in upload_pack() > where it isn't used yet. > > This patch series is the first part of an effort in this direction.
Thanks for following up on this! I think all of the patches here are moving in a good direction. I think there's a philosophical question about whether some of the functions should be taking the minimum set of fields from upload_pack_data, or just the whole struct. But seeing the opportunities for cleanup near the end, especially around little flags, I think passing the big struct around (like you've done here) is probably the best choice.
> While there are still a lot of static variables at the top of > 'upload-pack.c' after this patch series, it does a lot of ground work > and a number of cleanups.
Yeah, I think all of use_thin_pack, use_ofs_delta, etc, should be easy conversions on top (and will really give us the payoff).
-Peff