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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> wrote:
> Erik Faye-Lund <kusmabite@xxxxxxxxx> 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...
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]