From: Jeff King Date: Thu, 21 Nov 2024 09:18:32 GMT Subject: Re: [PATCH 1/6] csum-file: store the hash algorithm as a struct field Message-ID: <20241121091832.GC602681@coredump.intra.peff.net> In-Reply-To: <380133a11421fe4ce8428d11be479d78923bc5cc.1732130001.git.me@ttaylorr.com> On Wed, Nov 20, 2024 at 02:13:44PM -0500, Taylor Blau wrote: > Throughout the hashfile API, we rely on a reference to 'the_hash_algo', > and call its _usnafe function variants directly. s/usnafe/unsafe/ > Prepare for a future change where we may use a different 'git_hash_algo' > pointer (instead of just relying on 'the_hash_algo' throughout) by > making the 'git_hash_algo' pointer a member of the 'hashfile' structure > itself. This makes sense in the context of your series, which will eventually just hold the unsafe algo struct. But I also think it is a good step in general, because it means that rather than referring to the_hash_algo all over the place, we only do it when initializing the hashfile struct. In the long run, that should take a repository struct or a git_hash_algo pointer directly, and we'd want to pass it just once to hashfd(), etc. -Peff