From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH 0/4] hash: introduce generic wrappers to update hash contexts
Date: Mon, 3 Feb 2025 06:42:44 +0100 [thread overview]
Message-ID: <Z6BXVJraWurdMehX@pks.im> (raw)
In-Reply-To: <xmqqh65e97d8.fsf@gitster.g>
On Fri, Jan 31, 2025 at 10:16:19AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > this patch series introduces a couple of generic wrappers to update hash
> > contexts. Instead of updating contexts via function pointers provided by
> > the hash algorithm, we now remember the hash algorithm in the context
> > itself. As a result, subsequent calls that update the hash don't need to
> > remember which algorithm they used:
> >
> > ```
> > struct git_hash_ctx ctx;
> > struct object_id oid;
> >
> > git_hash_sha1_init(&ctx);
> > git_hash_update(&ctx, data);
> > git_hash_final_oid(&oid, &ctx);
> > ```
> >
> > This was discussed in [1] and [2].
> >
> > The series is built on top of master at 3b0d05c4a7 (The fifth batch,
> > 2025-01-29) with tb/unsafe-hashtcleanup at 04292c3796 (hash.h: drop
> > unsafe_ function variants, 2025-01-23) merged into it.
> >
> > Thanks!
> >
> > Patrick
> >
> > [1]: <Z3fhK1ACzJfVehM2@pks.im>
> > [2]: <Z4jyZCAwqOjZ-u2U@pks.im>
>
> Sounds sensible.
>
> It seems to textually interact with Karthik's attempt to pass down a
> hash_algo instance through the callchain in pack-write.c but I
> should be able to resolve the conflicts.
Ah, sorry, I didn't do a test merge with 'seen'. In any case, the
conflict resolution looks good to me, thanks!
Patrick
next prev parent reply other threads:[~2025-02-03 5:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 12:55 [PATCH 0/4] hash: introduce generic wrappers to update hash contexts Patrick Steinhardt
2025-01-31 12:55 ` [PATCH 1/4] hash: convert hashing context to a structure Patrick Steinhardt
2025-01-31 12:55 ` [PATCH 2/4] hash: stop typedeffing the hash context Patrick Steinhardt
2025-01-31 12:55 ` [PATCH 3/4] hash: provide generic wrappers to update hash contexts Patrick Steinhardt
2025-01-31 12:55 ` [PATCH 4/4] global: adapt callers to use generic hash context helpers Patrick Steinhardt
2025-01-31 18:16 ` [PATCH 0/4] hash: introduce generic wrappers to update hash contexts Junio C Hamano
2025-02-03 5:42 ` Patrick Steinhardt [this message]
2025-02-10 22:55 ` Taylor Blau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6BXVJraWurdMehX@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).