git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Oct 3, 2011, 18:48 UTC
Message-ID
<CABPQNSbN-sktYQUkLoywhCkc0_axgjY6Y9sN8ipeu6M+2VOVTA@mail.gmail.com>
In-Reply-To
<7vy5x1gbr6.fsf@alter.siamese.dyndns.org>
On Mon, Oct 3, 2011 at 8:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 40 quoted lines
> Erik Faye-Lund <kusmabite@gmail.com> writes:
>
>> Add an undocumented flag to git-archive that tells it that the
>> action originated from a remote, so features can be disabled.
>
>> 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?
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 15 in “port upload-archive to Windows”
  1. 0/4 port upload-archive to WindowsErik Faye-Lund, Sep 29, 2011
  2. 1/4 compat/win32/sys/poll.c: upgrade from upstreamErik Faye-Lund, Sep 29, 2011
  3. René ScharfeSep 30, 2011
  4. 2/4 mingw: fix compilation of poll-emulationErik Faye-Lund, Sep 29, 2011
  5. 3/4 enter_repo: do not modify inputErik Faye-Lund, Sep 29, 2011
  6. René ScharfeSep 30, 2011
  7. Phil HordOct 4, 2011
  8. Phil HordOct 4, 2011
  9. Erik Faye-LundOct 6, 2011
  10. 4/4 upload-archive: use start_command instead of forkErik Faye-Lund, Sep 29, 2011
  11. Junio C HamanoOct 3, 2011
  12. Erik Faye-LundOct 3, 2011
  13. Junio C HamanoOct 3, 2011
  14. Erik Faye-LundSep 29, 2011
  15. Jeff KingSep 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.