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

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

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Jul 28, 2011, 08:32 UTC
Message-ID
<CABPQNSYtpRpNQVW=QvyfFhmWge5-C+k85bs2EJeK8k0jdfHzrw@mail.gmail.com>
In-Reply-To
<7vmxga7zb9.fsf@alter.siamese.dyndns.org>

Sorry for the late reply. Things have been a bit hectic here in Oslo over the last week.

On Tue, Jul 19, 2011 at 11:09 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 45 quoted lines
> Erik Faye-Lund <kusmabite@gmail.com> writes:
>
>> @@ -18,28 +19,16 @@ 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;
>>
>> -     if (argc != 2)
>> -             usage(upload_archive_usage);
>> -
>> -     if (strlen(argv[1]) + 1 > sizeof(buf))
>> -             die("insanely long repository name");
>> -
>> -     strcpy(buf, argv[1]); /* enter-repo smudges its argument */
>> -
>> -     if (!enter_repo(buf, 0))
>> -             die("'%s' does not appear to be a git repository", buf);
>> -
>>       /* put received options in sent_argv[] */
>>       sent_argc = 1;
>> -     sent_argv[0] = "git-upload-archive";
>> +     sent_argv[0] = "archive";
>>       for (p = buf;;) {
>>               /* This will die if not enough free space in buf */
>>               len = packet_read_line(0, p, (buf + sizeof buf) - p);
>> @@ -62,9 +51,6 @@ static int run_upload_archive(int argc, const char **argv, const char *prefix)
>>               *p++ = 0;
>>       }
>>       sent_argv[sent_argc] = NULL;
>> -
>> -     /* parse all options sent by the client */
>> -     return write_archive(sent_argc, sent_argv, prefix, 0);
>>  }
>
> Hmm, how well would this change work with recent archive-filter work by
> Peff, especially with the "when remote, disable some features" bits?
>
Thanks for the notice. And no, not at all :(

OK then. I'll probably have to rewrite this to use start_async + dup-bonanza instead of start_command...

Previous: Junio C HamanoNext: Jeff King
Message 7 of 33 in “port upload-archive to Windows”
  1. 0/4 port upload-archive to WindowsErik Faye-Lund, Jul 18, 2011
  2. 1/4 compat/win32/sys/poll.c: upgrade from upstreamErik Faye-Lund, Jul 18, 2011
  3. 2/4 mingw: fix compilation of poll-emulationErik Faye-Lund, Jul 18, 2011
  4. 3/4 enter_repo: do not modify inputErik Faye-Lund, Jul 18, 2011
  5. 4/4 upload-archive: use start_command instead of forkErik Faye-Lund, Jul 18, 2011
  6. Junio C HamanoJul 19, 2011
  7. Erik Faye-LundJul 28, 2011
  8. Jeff KingJul 28, 2011
  9. Jeff KingJul 28, 2011
  10. Jeff KingJul 28, 2011
  11. Erik Faye-LundAug 1, 2011
  12. Jeff KingAug 1, 2011
  13. Erik Faye-LundAug 1, 2011
  14. Jeff KingAug 1, 2011
  15. René ScharfeAug 1, 2011
  16. Johannes SixtAug 1, 2011
  17. René ScharfeAug 1, 2011
  18. René ScharfeAug 1, 2011
  19. Jeff KingAug 2, 2011
  20. René ScharfeAug 2, 2011
  21. Jeff KingAug 2, 2011
  22. Johannes SixtAug 2, 2011
  23. Jeff KingAug 3, 2011
  24. René ScharfeAug 6, 2011
  25. Johannes SixtAug 7, 2011
  26. Jeff KingAug 7, 2011
  27. René ScharfeAug 8, 2011
  28. Jeff KingAug 9, 2011
  29. René ScharfeAug 9, 2011
  30. Jeff KingAug 9, 2011
  31. Erik Faye-LundSep 29, 2011
  32. René ScharfeSep 29, 2011
  33. Erik Faye-LundSep 29, 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.