about summary refs log tree commit diff
path: root/third_party/git/builtin/remote-fd.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/remote-fd.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/remote-fd.c')
-rw-r--r--third_party/git/builtin/remote-fd.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/third_party/git/builtin/remote-fd.c b/third_party/git/builtin/remote-fd.c
deleted file mode 100644
index 91dfe07e06a1..000000000000
--- a/third_party/git/builtin/remote-fd.c
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "builtin.h"
-#include "transport.h"
-
-static const char usage_msg[] =
-	"git remote-fd <remote> <url>";
-
-/*
- * URL syntax:
- *	'fd::<inoutfd>[/<anything>]'		Read/write socket pair
- *						<inoutfd>.
- *	'fd::<infd>,<outfd>[/<anything>]'	Read pipe <infd> and write
- *						pipe <outfd>.
- *	[foo] indicates 'foo' is optional. <anything> is any string.
- *
- * The data output to <outfd>/<inoutfd> should be passed unmolested to
- * git-receive-pack/git-upload-pack/git-upload-archive and output of
- * git-receive-pack/git-upload-pack/git-upload-archive should be passed
- * unmolested to <infd>/<inoutfd>.
- *
- */
-
-#define MAXCOMMAND 4096
-
-static void command_loop(int input_fd, int output_fd)
-{
-	char buffer[MAXCOMMAND];
-
-	while (1) {
-		size_t i;
-		if (!fgets(buffer, MAXCOMMAND - 1, stdin)) {
-			if (ferror(stdin))
-				die("Input error");
-			return;
-		}
-		/* Strip end of line characters. */
-		i = strlen(buffer);
-		while (i > 0 && isspace(buffer[i - 1]))
-			buffer[--i] = 0;
-
-		if (!strcmp(buffer, "capabilities")) {
-			printf("*connect\n\n");
-			fflush(stdout);
-		} else if (!strncmp(buffer, "connect ", 8)) {
-			printf("\n");
-			fflush(stdout);
-			if (bidirectional_transfer_loop(input_fd,
-				output_fd))
-				die("Copying data between file descriptors failed");
-			return;
-		} else {
-			die("Bad command: %s", buffer);
-		}
-	}
-}
-
-int cmd_remote_fd(int argc, const char **argv, const char *prefix)
-{
-	int input_fd = -1;
-	int output_fd = -1;
-	char *end;
-
-	if (argc != 3)
-		usage(usage_msg);
-
-	input_fd = (int)strtoul(argv[2], &end, 10);
-
-	if ((end == argv[2]) || (*end != ',' && *end != '/' && *end))
-		die("Bad URL syntax");
-
-	if (*end == '/' || !*end) {
-		output_fd = input_fd;
-	} else {
-		char *end2;
-		output_fd = (int)strtoul(end + 1, &end2, 10);
-
-		if ((end2 == end + 1) || (*end2 != '/' && *end2))
-			die("Bad URL syntax");
-	}
-
-	command_loop(input_fd, output_fd);
-	return 0;
-}