[PATCH 0/7] git_hash_*() quality-of-life improvements
- From
Jeff King <peff@peff.net>
- Date
- Jul 7, 2026, 04:55 UTC
- Message-ID
- <20260707045556.GA1288172@coredump.intra.peff.net>
This implements the "idempotent git_hash_discard()" discussed in this subthread:
https://lore.kernel.org/git/20260702080707.GG2029434@coredump.intra.peff.net/
with associated cleanups.
It should be applied on top of jk/hash-algo-leak-fixes.
[1/7]: hash: use git_hash_init() consistently [2/7]: hash: convert remaining direct function calls [3/7]: hash: document function pointers and wrappers [4/7]: hash: make git_hash_discard() idempotent [5/7]: csum-file: use idempotent git_hash_discard() [6/7]: http: use idempotent git_hash_discard() [7/7]: hash: check ctx->active flag in all wrapper functions
builtin/fast-import.c | 4 +-- builtin/index-pack.c | 6 ++-- builtin/patch-id.c | 2 +- builtin/receive-pack.c | 6 ++-- builtin/submodule--helper.c | 10 +++--- builtin/unpack-objects.c | 4 +-- csum-file.c | 23 +++++--------- diff.c | 4 +-- hash.c | 16 ++++++++++ hash.h | 44 +++++++++++++++++++------- http-push.c | 2 +- http.c | 9 ++---- http.h | 1 - object-file.c | 17 +++++----- pack-check.c | 2 +- pack-write.c | 6 ++-- read-cache.c | 6 ++-- rerere.c | 5 +-- t/helper/test-hash-speed.c | 2 +- t/helper/test-hash.c | 2 +- t/helper/test-synthesize.c | 33 ++++++++++--------- t/unit-tests/u-hash.c | 2 +- tools/coccinelle/hash.cocci | 63 +++++++++++++++++++++++++++++++++++++ trace2/tr2_sid.c | 2 +- 24 files changed, 181 insertions(+), 90 deletions(-) create mode 100644 tools/coccinelle/hash.cocci
-Peff