Thread (158 messages) 158 messages, 3 authors, 2025-10-16

Re: [PATCH 40/49] builtin/repack.c: introduce `struct write_pack_opts`

From: Jeff King <hidden>
Date: 2025-10-15 10:28:35

On Sun, Sep 28, 2025 at 06:09:51PM -0400, Taylor Blau wrote:
Instead of repeating those arguments for each function, let's extract an
options struct called "write_pack_opts" which has these three parameters
as member fields. While we're at it, add fields for "packdir," and
"packtmp", both of which are static variables within the builtin, and
need to be read from within these two functions.
Makes sense, although...
+		struct write_pack_opts opts = {
+			.po_args = &po_args,
+			.destination = filter_to,
+			.pack_prefix = find_pack_prefix(packdir, packtmp),
+			.packdir = packdir,
+			.packtmp = packtmp,
+		};
...since we are now passing packdir and packtmp anyway, and pack_prefix
is derived from those, should the called function just do that
derivation itself? Or do we expect that some callers may eventually use
a different prefix?

Probably not a huge deal either way, but maybe an easy way to tighten up
the interface a bit.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help