From: Patrick Steinhardt Date: Tue, 10 Mar 2026 12:09:14 GMT Subject: Re: [PATCH v2 08/10] csum-file: introduce `hashfd_ext()` Message-ID: In-Reply-To: On Wed, Mar 04, 2026 at 02:11:31PM -0800, Junio C Hamano wrote: > Patrick Steinhardt writes: > > > -static struct hashfile *hashfd_internal(const struct git_hash_algo *algop, > > - int fd, const char *name, > > - struct progress *tp, > > - size_t buffer_len) > > +struct hashfile *hashfd_ext(const struct git_hash_algo *algop, > > + int fd, const char *name, > > + const struct hashfd_options *opts) > > What does _ext stand for? "extended". It's a pattern that we use in lots of other places, too. > More seriously, this essentially chooses to pick two parameters > hashfd_internal() takes and put them in a struct, which would give > us a clear upgrade path to add more to the structure without having > to change the function signature. But what is the criteria used to > choose these two among 5 parameters the original function takes? The criteria is mostly whether the parameter is optional or not. The algorithm, file descriptor and name are all mandatory, whereas all the other parts in the options structure are optional. Patrick