From f54ca6ae72e32e34f2042a93f92949e3ded11a36 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Tue, 27 Aug 2024 14:27:17 -0700 Subject: check-mailmap: add options for additional mailmap sources The git check-mailmap command reads the mailmap from either the default .mailmap location and then from the mailmap.blob and mailmap.file configurations. A following change to git send-email will want to support new configuration options based on the configured identity. The identity-based configuration and options only make sense in the context of git send-email. Expose the read_mailmap_file and read_mailmap_blob functions from mailmap.c. Teach git check-mailmap the --mailmap-file and --mailmap-blob options which load the additional mailmap sources. Signed-off-by: Jacob Keller Signed-off-by: Junio C Hamano --- mailmap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mailmap.c') diff --git a/mailmap.c b/mailmap.c index 2d0212f444..4212e553e7 100644 --- a/mailmap.c +++ b/mailmap.c @@ -142,11 +142,8 @@ static void read_mailmap_line(struct string_list *map, char *buffer) add_mapping(map, name1, email1, name2, email2); } -/* Flags for read_mailmap_file() */ -#define MAILMAP_NOFOLLOW (1<<0) - -static int read_mailmap_file(struct string_list *map, const char *filename, - unsigned flags) +int read_mailmap_file(struct string_list *map, const char *filename, + unsigned flags) { char buffer[1024]; FILE *f; @@ -186,7 +183,7 @@ static void read_mailmap_string(struct string_list *map, char *buf) } } -static int read_mailmap_blob(struct string_list *map, const char *name) +int read_mailmap_blob(struct string_list *map, const char *name) { struct object_id oid; char *buf; -- cgit v1.3-6-g1900