about summary refs log tree commit diff
path: root/third_party/git/builtin/check-mailmap.c
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/builtin/check-mailmap.c
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/builtin/check-mailmap.c')
-rw-r--r--third_party/git/builtin/check-mailmap.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/third_party/git/builtin/check-mailmap.c b/third_party/git/builtin/check-mailmap.c
deleted file mode 100644
index cdce144f3b7f..000000000000
--- a/third_party/git/builtin/check-mailmap.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#include "builtin.h"
-#include "config.h"
-#include "mailmap.h"
-#include "parse-options.h"
-#include "string-list.h"
-
-static int use_stdin;
-static const char * const check_mailmap_usage[] = {
-N_("git check-mailmap [<options>] <contact>..."),
-NULL
-};
-
-static const struct option check_mailmap_options[] = {
-	OPT_BOOL(0, "stdin", &use_stdin, N_("also read contacts from stdin")),
-	OPT_END()
-};
-
-static void check_mailmap(struct string_list *mailmap, const char *contact)
-{
-	const char *name, *mail;
-	size_t namelen, maillen;
-	struct ident_split ident;
-
-	if (split_ident_line(&ident, contact, strlen(contact)))
-		die(_("unable to parse contact: %s"), contact);
-
-	name = ident.name_begin;
-	namelen = ident.name_end - ident.name_begin;
-	mail = ident.mail_begin;
-	maillen = ident.mail_end - ident.mail_begin;
-
-	map_user(mailmap, &mail, &maillen, &name, &namelen);
-
-	if (namelen)
-		printf("%.*s ", (int)namelen, name);
-	printf("<%.*s>\n", (int)maillen, mail);
-}
-
-int cmd_check_mailmap(int argc, const char **argv, const char *prefix)
-{
-	int i;
-	struct string_list mailmap = STRING_LIST_INIT_NODUP;
-
-	git_config(git_default_config, NULL);
-	argc = parse_options(argc, argv, prefix, check_mailmap_options,
-			     check_mailmap_usage, 0);
-	if (argc == 0 && !use_stdin)
-		die(_("no contacts specified"));
-
-	read_mailmap(&mailmap, NULL);
-
-	for (i = 0; i < argc; ++i)
-		check_mailmap(&mailmap, argv[i]);
-	maybe_flush_or_die(stdout, "stdout");
-
-	if (use_stdin) {
-		struct strbuf buf = STRBUF_INIT;
-		while (strbuf_getline_lf(&buf, stdin) != EOF) {
-			check_mailmap(&mailmap, buf.buf);
-			maybe_flush_or_die(stdout, "stdout");
-		}
-		strbuf_release(&buf);
-	}
-
-	clear_mailmap(&mailmap);
-	return 0;
-}