Thread (55 messages) 55 messages, 4 authors, 2025-01-23

Re: [PATCH 1/6] csum-file: store the hash algorithm as a struct field

From: Jeff King <hidden>
Date: 2024-11-21 09:18:33

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help