]> git.ipfire.org Git - thirdparty/git.git/commit
fast-export: add a "data" callback parameter to anonymize_str()
authorJeff King <peff@peff.net>
Tue, 23 Jun 2020 15:25:03 +0000 (11:25 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Jun 2020 02:56:26 +0000 (19:56 -0700)
commitd5bf91fde4430532eb725425c3ef9827048af6b5
tree4e316197825a20140e15086073eb90152db6f195
parent6416a865da44ac8e27e5dbcafd6a8b76caf09f5a
fast-export: add a "data" callback parameter to anonymize_str()

The anonymize_str() function takes a generator callback, but there's no
way to pass extra context to it. Let's add the usual "void *data"
parameter to the generator interface and pass it along.

This is mildly annoying for existing callers, all of which pass NULL,
but is necessary to avoid extra globals in some cases we'll add in a
subsequent patch.

While we're touching each of these callbacks, we can further observe
that none of them use the existing orig/len parameters at all. This
makes sense, since the point is for their output to have no discernable
basis in the original (my original version had some notion that we might
use a one-way function to obfuscate the names, but it was never
implemented). So let's drop those extra parameters. If a caller really
wants to do something with them, it can pass a struct through the new
data parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-export.c