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

[PATCH v6 0/6] support remote archive via stateless transport

From
Jiang Xin <worldhello.net@gmail.com>
Date
Jan 21, 2024, 13:15 UTC
Message-ID
<cover.1705841443.git.zhiyou.jx@alibaba-inc.com>
In-Reply-To
<cover.1705411391.git.zhiyou.jx@alibaba-inc.com>
From: Jiang Xin <zhiyou.jx@alibaba-inc.com>

"git archive --remote=<remote>" learned to talk over the smart http (aka stateless) transport.

# Changes since v5
Change commit messages.
# range-diff v5...v6
1:  f3fef46c05 ! 1:  d75e6d27ac transport-helper: no connection restriction in connect_helper
    @@ Commit message
     
         Later, commit edc9caf7 (transport-helper: introduce stateless-connect,
         2018-03-15) added a way for a transport without the ".connect" method
    -    to establish a "stateless" connection in protocol-v2, where
    +    to establish a "stateless" connection in protocol v2, where
         process_connect_service() was taught to handle the ".stateless_connect"
         method, making the old protection too strict. But commit edc9caf7 forgot
    -    to adjust this protection accordingly.
    +    to adjust this protection accordingly. Even at the time of commit
    +    b236752a, this protection seemed redundant, since
    +    process_connect_service() would return 0 if the connection could not be
    +    established, and connect_helper() would still die() early.
     
    -    Remove the restriction in the "connect_helper()" function and give the
    -    function "process_connect_service()" the opportunity to establish a
    -    connection using ".connect" or ".stateless_connect" for protocol v2. So
    -    we can connect with a stateless-rpc and do something useful. E.g., in a
    -    later commit, implements remote archive for a repository over HTTP
    -    protocol.
    +    Remove the restriction in connect_helper() and give the function
    +    process_connect_service() the opportunity to establish a connection
    +    using ".connect" or ".stateless_connect" for protocol v2. So we can
    +    connect with a stateless-rpc and do something useful. E.g., in a later
    +    commit, implements remote archive for a repository over HTTP protocol.
     
         Helped-by: Junio C Hamano <gitster@pobox.com>
         Helped-by: Linus Arver <linusa@google.com>
2:  6be331b22d ! 2:  320526dc56 remote-curl: supports git-upload-archive service
    @@ Commit message
     
         Add new service (git-upload-archive) support in remote-curl, so we can
         support remote archive over HTTP/HTTPS protocols. Differences between
    -    git-upload-archive and other serices:
    +    git-upload-archive and other services:
     
          1. The git-archive program does not expect to see protocol version and
             capabilities when connecting to remote-helper, so do not send them
             in remote-curl for the git-upload-archive service.
     
    -     2. We need to detect protocol version by calling discover_refs(),
    +     2. We need to detect protocol version by calling discover_refs().
             Fallback to use the git-upload-pack service (which, like
             git-upload-archive, is a read-only operation) to discover protocol
             version.
     
    +    Helped-by: Linus Arver <linusa@google.com>
         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
     
      ## remote-curl.c ##
3:  aabc8e1a2a ! 3:  72e575d28a transport-helper: protocol-v2 supports upload-archive
    @@ Metadata
     Author: Jiang Xin <zhiyou.jx@alibaba-inc.com>
     
      ## Commit message ##
    -    transport-helper: protocol-v2 supports upload-archive
    +    transport-helper: protocol v2 supports upload-archive
     
    -    We used to support only git-upload-pack service for protocol-v2. In
    +    We used to support only git-upload-pack service for protocol v2. In
         order to support remote archive over HTTP/HTTPS protocols, add new
    -    service support for git-upload-archive in protocol-v2.
    +    service support for git-upload-archive in protocol v2.
     
    +    Helped-by: Linus Arver <linusa@google.com>
         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
     
      ## transport-helper.c ##
4:  fdab4abb43 = 4:  390d13c074 http-backend: new rpc-service for git-upload-archive
5:  6ac0c8e105 ! 5:  1c9f7755d3 transport-helper: call do_take_over() in connect_helper
    @@ Commit message
         After successfully connecting to the smart transport by calling
         process_connect_service() in connect_helper(), run do_take_over() to
         replace the old vtable with a new one which has methods ready for the
    -    smart transport connection. This will fix the exit code of git-archive
    +    smart transport connection. This fixes the exit code of git-archive
         in test case "archive remote http repository" of t5003.
     
         The connect_helper() function is used as the connect method of the
    @@ Commit message
         do_take_over(), it may fail to call transport_disconnect() in
         run_remote_archiver() of "builtin/archive.c". This is because for a
         stateless connection and a service like "git-upload-archive", the
    -    remote helper may receive a SIGPIPE signal and exit early. To have a
    -    graceful disconnect method by calling do_take_over() will solve this
    -    issue.
    +    remote helper may receive a SIGPIPE signal and exit early. Call
    +    do_take_over() to have a graceful disconnect method, so that we still
    +    call transport_disconnect() even if the remote helper exits early.
     
         Helped-by: Linus Arver <linusa@google.com>
         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
6:  423a89c593 = 6:  18bc8753df transport-helper: call do_take_over() in process_connect
---
Jiang Xin (6):
  transport-helper: no connection restriction in connect_helper
  remote-curl: supports git-upload-archive service
  transport-helper: protocol v2 supports upload-archive
  http-backend: new rpc-service for git-upload-archive
  transport-helper: call do_take_over() in connect_helper
  transport-helper: call do_take_over() in process_connect
 http-backend.c         | 13 ++++++++++---
 remote-curl.c          | 14 +++++++++++---
 t/t5003-archive-zip.sh | 34 ++++++++++++++++++++++++++++++++++
 transport-helper.c     | 29 +++++++++++++----------------
 4 files changed, 68 insertions(+), 22 deletions(-)
-- 
2.43.0
Previous: Jiang XinNext: Jiang Xin
Message 45 of 61 in “transport-helper: no connection restriction in connect_helper”
  1. 1/2 transport-helper: no connection restriction in connect_helperJiang Xin, Sep 19, 2023
  2. 2/2 archive: support remote archive from stateless transportJiang Xin, Sep 19, 2023
  3. Junio C HamanoSep 19, 2023
  4. Jiang XinSep 20, 2023
  5. 0/3 support remote archive from stateless transportJiang Xin, Sep 23, 2023
  6. Junio C HamanoSep 25, 2023
  7. Jiang XinSep 26, 2023
  8. 1/3 transport-helper: no connection restriction in connect_helperJiang Xin, Sep 23, 2023
  9. Junio C HamanoSep 25, 2023
  10. 2/3 transport-helper: run do_take_over in connect_helperJiang Xin, Sep 23, 2023
  11. Junio C HamanoSep 25, 2023
  12. Jiang XinOct 4, 2023
  13. 0/4 support remote archive from stateless transportJiang Xin, Oct 4, 2023
  14. 1/4 transport-helper: no connection restriction in connect_helperJiang Xin, Oct 4, 2023
  15. 3/4 transport-helper: call do_take_over() in connect_helperJiang Xin, Oct 4, 2023
  16. 4/4 archive: support remote archive from stateless transportJiang Xin, Oct 4, 2023
  17. 2/4 transport-helper: call do_take_over() in process_connectJiang Xin, Oct 4, 2023
  18. Junio C HamanoOct 4, 2023
  19. 0/4 support remote archive via stateless transportJiang Xin, Dec 14, 2023
  20. 1/4 transport-helper: no connection restriction in connect_helperJiang Xin, Dec 14, 2023
  21. Linus ArverJan 12, 2024
  22. Junio C HamanoJan 12, 2024
  23. Jiang XinJan 16, 2024
  24. Linus ArverJan 18, 2024
  25. Jiang XinJan 19, 2024
  26. Linus ArverJan 20, 2024
  27. 2/4 transport-helper: call do_take_over() in process_connectJiang Xin, Dec 14, 2023
  28. 3/4 transport-helper: call do_take_over() in connect_helperJiang Xin, Dec 14, 2023
  29. Linus ArverJan 12, 2024
  30. Jiang XinJan 16, 2024
  31. 4/4 archive: support remote archive from stateless transportJiang Xin, Dec 14, 2023
  32. Linus ArverJan 12, 2024
  33. 0/6 support remote archive via stateless transportJiang Xin, Jan 16, 2024
  34. 1/6 transport-helper: no connection restriction in connect_helperJiang Xin, Jan 16, 2024
  35. Linus ArverJan 20, 2024
  36. 2/6 remote-curl: supports git-upload-archive serviceJiang Xin, Jan 16, 2024
  37. Linus ArverJan 20, 2024
  38. 3/6 transport-helper: protocol-v2 supports upload-archiveJiang Xin, Jan 16, 2024
  39. 4/6 http-backend: new rpc-service for git-upload-archiveJiang Xin, Jan 16, 2024
  40. 5/6 transport-helper: call do_take_over() in connect_helperJiang Xin, Jan 16, 2024
  41. Linus ArverJan 20, 2024
  42. 6/6 transport-helper: call do_take_over() in process_connectJiang Xin, Jan 16, 2024
  43. Linus ArverJan 20, 2024
  44. Jiang XinJan 21, 2024
  45. 0/6 support remote archive via stateless transportJiang Xin, Jan 21, 2024
  46. 1/6 transport-helper: no connection restriction in connect_helperJiang Xin, Jan 21, 2024
  47. 2/6 remote-curl: supports git-upload-archive serviceJiang Xin, Jan 21, 2024
  48. 3/6 transport-helper: protocol v2 supports upload-archiveJiang Xin, Jan 21, 2024
  49. 4/6 http-backend: new rpc-service for git-upload-archiveJiang Xin, Jan 21, 2024
  50. 5/6 transport-helper: call do_take_over() in connect_helperJiang Xin, Jan 21, 2024
  51. 6/6 transport-helper: call do_take_over() in process_connectJiang Xin, Jan 21, 2024
  52. Linus ArverJan 21, 2024
  53. Junio C HamanoJan 22, 2024
  54. 3/3 archive: support remote archive from stateless transportJiang Xin, Sep 23, 2023
  55. Eric SunshineSep 24, 2023
  56. Jiang XinSep 24, 2023
  57. rsbecker@nexbridge.comSep 24, 2023
  58. Jiang XinSep 25, 2023
  59. rsbecker@nexbridge.comSep 25, 2023
  60. Phillip WoodSep 24, 2023
  61. Jiang XinSep 24, 2023

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.