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

Re: [PATCH] [RFC] transport: add --show-service option

From
ZheNing Hu <adlternative@gmail.com>
Date
Apr 27, 2023, 04:35 UTC
Message-ID
<CAOLTT8Qmo31YExXUOPk2sx73b734wuxiD3AUX0UAnPo9WSqpfQ@mail.gmail.com>
In-Reply-To
<xmqq354o8v8u.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2023年4月25日周二 12:02写道:
Show 25 quoted lines
>
> "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: ZheNing Hu <adlternative@gmail.com>
> >
> > Without using protocol v2, the git server needs to send a pktline
> > "# service=$servicename" to the git client first. This often
> > requires the git server to implement it independently, but it can
> > be delegated to the `git receive-pack` and `git upload-pack` to complete
> > the work proactively. Therefore, the `--show-service` option is added
> > to `git receive-pack` and `git upload-pack`, which can be used to send
> > the "# service=$servicename" pktline, making the logic of the git
> > server more concise.
> >
> > Note that this `--show-service` option can only be used together with
> > `--http-backend-info-refs` and it is not applicable when using protocol v2.
> >
> > Signed-off-by: ZheNing Hu <adlternative@gmail.com>
> > ---
>
> The above is a very well written description of why we _can_ do
> this, but it is unclear why we would _want_ to do this.  What do we
> gain by letting the individual services to declare "we are serving
> this!"?  Do we lose an extra fork & process (it does not seem to be
> the case)?

When I was implementing a small git http server, I wanted to delegate everything to upload-pack and receive-pack. Everything else was fine, the only thing I was not satisfied with was the need to send an additional "#service=$servername" message when the protocol is v1. To be honest, the $servername here can only be "git-upload-pack" and "git-receive-pack", and the git client does not actually do anything extra with this message. Why not let git upload-pack and git receive-pack do it?

The "--show-service" option is not a functional requirement, it just simplifies the logic of the git server.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “[RFC] transport: add --show-service option”
  1. [RFC] transport: add --show-service optionZheNing Hu via GitGitGadget, Apr 24, 2023
  2. Junio C HamanoApr 25, 2023
  3. ZheNing HuApr 27, 2023
  4. Junio C HamanoApr 27, 2023
  5. [RFC] transport: add --show-service optionZheNing Hu via GitGitGadget, May 4, 2023
  6. ZheNing HuMay 10, 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.