Re: [PATCH v3 4/4] upload-archive: use start_command instead of fork

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v3 4/4] upload-archive: use start_command instead of fork

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:10

Erik Faye-Lund [off-list ref] writes:
Add an undocumented flag to git-archive that tells it that the
action originated from a remote, so features can be disabled.
quoted hunk
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 2d0b383..c57e8bd 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -6,6 +6,7 @@
 #include "archive.h"
 #include "pkt-line.h"
 #include "sideband.h"
+#include "run-command.h"
 
 static const char upload_archive_usage[] =
 	"git upload-archive <repo>";
@@ -18,28 +19,17 @@ static const char lostchild[] =
 
 #define MAX_ARGS (64)
 
-static int run_upload_archive(int argc, const char **argv, const char *prefix)
+static void prepare_argv(const char **sent_argv, const char **argv)
 {
-	const char *sent_argv[MAX_ARGS];
 	const char *arg_cmd = "argument ";
 	char *p, buf[4096];
 	int sent_argc;
 	int len;
 
+	sent_argc = 2;
+	sent_argv[0] = "archive";
+	sent_argv[1] = "--remote-request";
 	for (p = buf;;) {
 		/* This will die if not enough free space in buf */
 		len = packet_read_line(0, p, (buf + sizeof buf) - p);
Hmm, forgetting the "Windows" for a while, does this client work against
the remote repositories that are running deployed versions of Git?

Re: [PATCH v3 4/4] upload-archive: use start_command instead of fork

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:52:10

On Mon, Oct 3, 2011 at 8:39 PM, Junio C Hamano [off-list ref] wrote:
Erik Faye-Lund [off-list ref] writes:
quoted
Add an undocumented flag to git-archive that tells it that the
action originated from a remote, so features can be disabled.
quoted
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 2d0b383..c57e8bd 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -6,6 +6,7 @@
 #include "archive.h"
 #include "pkt-line.h"
 #include "sideband.h"
+#include "run-command.h"

 static const char upload_archive_usage[] =
      "git upload-archive <repo>";
@@ -18,28 +19,17 @@ static const char lostchild[] =
 #define MAX_ARGS (64)

-static int run_upload_archive(int argc, const char **argv, const char *prefix)
+static void prepare_argv(const char **sent_argv, const char **argv)
 {
-     const char *sent_argv[MAX_ARGS];
      const char *arg_cmd = "argument ";
      char *p, buf[4096];
      int sent_argc;
      int len;

+     sent_argc = 2;
+     sent_argv[0] = "archive";
+     sent_argv[1] = "--remote-request";
      for (p = buf;;) {
              /* This will die if not enough free space in buf */
              len = packet_read_line(0, p, (buf + sizeof buf) - p);
Hmm, forgetting the "Windows" for a while, does this client work against
the remote repositories that are running deployed versions of Git?
It should, the change is completely server-side. The first two entries
in sent_argv aren't sent over the network protocol, but the ones that
follow them are.

Or did I misunderstand your concern?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help