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

Re: [PATCH 04/11] Resumable clone: add prime-clone to remote-curl

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 19, 2016, 13:52 UTC
Message-ID
<CACsJy8C+0M8o15E+iVX+f=izO2CtK7U642NC=XXaG-g41wYAUg@mail.gmail.com>
In-Reply-To
<1473984742-12516-5-git-send-email-kevin.m.wern@gmail.com>
On Fri, Sep 16, 2016 at 7:12 AM, Kevin Wern <kevin.m.wern@gmail.com> wrote:
Show 28 quoted lines
> +static void prime_clone(void)
> +{
> +       char *result, *result_full, *line;
> +       size_t result_len;
> +       int err = 0, one_successful = 0;
> +
> +       if (request_service("git-prime-clone", &result_full, &result,
> +                       &result_len, HTTP_ERROR_GENTLE)) {
> +               while (line = packet_read_line_buf_gentle(&result, &result_len,
> +                                                         NULL)) {
> +                       char *space = strchr(line ,' ');
> +
> +                       // We will eventually support multiple resources, so
> +                       // always parse the whole message
> +                       if (err)
> +                               continue;
> +                       if (!space || strchr(space + 1, ' ')) {
> +                               if (options.verbosity > 1)
> +                                       fprintf(stderr, "prime clone "
> +                                               "protocol error: got '%s'\n",
> +                                               line);
> +                               printf("error\n");
> +                               err = 1;
> +                               continue;
> +                       }
> +
> +                       one_successful = 1;
> +                       printf("%s\n", line);

A brief overview for this service in Documentation/technical/http-protocol.txt (and maybe Documentation/gitremote-helpers.txt as well) would be great help. It's a bit hard to follow because at this point I don't know anything about the server side (and on top of that I was confused between http send/receive vs transport send/receive, but this is my fault).

Show 10 quoted lines
> +               }
> +               if (!one_successful && options.verbosity > 1)
> +                       fprintf(stderr, "did not get required components for "
> +                               "alternate resource\n");
> +       }
> +
> +       printf("\n");
> +       fflush(stdout);
> +       free(result_full);
> +}
-- 
Duy
Previous: Kevin WernNext: Kevin Wern
Message 12 of 39 in “Resumable clone”
  1. 00/11 Resumable cloneKevin Wern, Sep 16, 2016
  2. 01/11 Resumable clone: create service git-prime-cloneKevin Wern, Sep 16, 2016
  3. Junio C HamanoSep 16, 2016
  4. Kevin WernSep 28, 2016
  5. 02/11 Resumable clone: add prime-clone endpointsKevin Wern, Sep 16, 2016
  6. Duy NguyenSep 19, 2016
  7. Kevin WernSep 28, 2016
  8. 03/11 pkt-line: create gentle packet_read_line functionsKevin Wern, Sep 16, 2016
  9. Junio C HamanoSep 16, 2016
  10. Kevin WernSep 28, 2016
  11. 04/11 Resumable clone: add prime-clone to remote-curlKevin Wern, Sep 16, 2016
  12. Duy NguyenSep 19, 2016
  13. Kevin WernSep 28, 2016
  14. 05/11 Resumable clone: add output parsing to connect.cKevin Wern, Sep 16, 2016
  15. 06/11 Resumable clone: implement transport_prime_cloneKevin Wern, Sep 16, 2016
  16. 07/11 Resumable clone: add resumable download to http/curlKevin Wern, Sep 16, 2016
  17. Junio C HamanoSep 16, 2016
  18. Kevin WernSep 28, 2016
  19. 08/11 Resumable clone: create transport_download_primerKevin Wern, Sep 16, 2016
  20. 10/11 run command: add RUN_COMMAND_NO_STDOUTKevin Wern, Sep 16, 2016
  21. Junio C HamanoSep 16, 2016
  22. Johannes SchindelinSep 18, 2016
  23. Kevin WernSep 28, 2016
  24. Junio C HamanoSep 28, 2016
  25. Kevin WernSep 28, 2016
  26. 09/11 path: add resumable markerKevin Wern, Sep 16, 2016
  27. Duy NguyenSep 19, 2016
  28. 11/11 Resumable clone: implement primer logic in git-cloneKevin Wern, Sep 16, 2016
  29. Junio C HamanoSep 16, 2016
  30. Kevin WernSep 28, 2016
  31. Duy NguyenSep 19, 2016
  32. Junio C HamanoSep 19, 2016
  33. Kevin WernSep 28, 2016
  34. Junio C HamanoSep 16, 2016
  35. Eric WongSep 27, 2016
  36. Junio C HamanoSep 27, 2016
  37. Junio C HamanoSep 28, 2016
  38. Junio C HamanoSep 28, 2016
  39. Eric WongSep 28, 2016

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.