From: Karthik Nayak Date: Wed, 22 Apr 2026 12:20:20 GMT Subject: Re: [PATCH 1/8] refs: remove unused typedef 'ref_transaction_commit_fn' Message-ID: In-Reply-To: Patrick Steinhardt writes: > On Mon, Apr 20, 2026 at 12:11:59PM +0200, Karthik Nayak wrote: >> diff --git a/refs/refs-internal.h b/refs/refs-internal.h >> index d79e35fd26..2d963cc4f4 100644 >> --- a/refs/refs-internal.h >> +++ b/refs/refs-internal.h >> @@ -421,10 +421,6 @@ typedef int ref_transaction_abort_fn(struct ref_store *refs, >> struct ref_transaction *transaction, >> struct strbuf *err); >> >> -typedef int ref_transaction_commit_fn(struct ref_store *refs, >> - struct ref_transaction *transaction, >> - struct strbuf *err); >> - >> typedef int optimize_fn(struct ref_store *ref_store, >> struct refs_optimize_opts *opts); >> > > I'm in general not much of a fan of these typedefs -- there's not really > much of a point why we'd need them in the first place. We don't use them > as a type anywhere but in the struct definition for the ref backend. So > we could just as well move them in there, which would also ensure that > they cannot become stale in the first place. > > Patrick I do like them, when reading `struct ref_storage_be {}` with these typedefs, the interface is simplified and I only need to know what are the different functions which need to be implemented without being exposed to the details of each of the functions. The details are available in the typedefs. I'll leave it out of this series though.