git/tools
Jeff King b87af5aa77 hash: convert remaining direct function calls
The previous patch added a coccinelle rule to make sure callers always
use git_hash_init() rather than direct function pointers from the algo
struct.

Let's do the same for the rest of the git_hash_*() wrappers. I split
these out because they're a bit different: they implicitly use the algop
pointer in the git_hash_ctx. So when we convert:

  -algo->update_fn(&ctx, buf, len);
  +git_hash_update(&ctx, buf, len);

we drop the reference to algo entirely! But this is always going to be
the right thing. If "algo" does not match what is in ctx.algop, then
we'd already be invoking undefined behavior.

So in addition to making it possible to add more logic to the
git_hash_*() functions, we're avoiding the need to pass around the extra
algo pointer and make sure that it matches what's in "ctx".

The rest of the patch is the mechanical application of that coccinelle
patch, plus a minor cleanup in test-synthesize.c to drop a now-unused
function parameter (since we don't have to pass around the algo
separately anymore).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-07 21:56:00 -07:00
..
coccinelle hash: convert remaining direct function calls 2026-07-07 21:56:00 -07:00
update-unicode
README.md
check-builtins.sh
coverage-diff.sh
detect-compiler
generate-cmdlist.sh
generate-configlist.sh generate-configlist: collapse depfile for older Ninja 2026-05-16 22:19:56 +09:00
generate-hooklist.sh
generate-perl.sh
generate-python.sh
generate-script.sh
meson.build
precompiled.h

README.md

Developer Tooling

This directory is expected to contain all sorts of tooling that relates to our build infrastructure. This includes scripts and inputs required by our build systems, but also scripts that developers are expected to run manually.