From: ZheNing Hu <adlternative@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com>,
git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Zeger-Jan van de Weg" <zegerjan@gitlab.com>
Subject: Re: [PATCH] [RFC] transport: add --show-service option
Date: Thu, 27 Apr 2023 12:35:23 +0800 [thread overview]
Message-ID: <CAOLTT8Qmo31YExXUOPk2sx73b734wuxiD3AUX0UAnPo9WSqpfQ@mail.gmail.com> (raw)
In-Reply-To: <xmqq354o8v8u.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2023年4月25日周二 12:02写道:
>
> "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.
next prev parent reply other threads:[~2023-04-27 4:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 13:17 [PATCH] [RFC] transport: add --show-service option ZheNing Hu via GitGitGadget
2023-04-25 4:02 ` Junio C Hamano
2023-04-27 4:35 ` ZheNing Hu [this message]
2023-04-27 5:50 ` Junio C Hamano
2023-05-04 15:28 ` [PATCH v2] " ZheNing Hu via GitGitGadget
2023-05-10 8:15 ` ZheNing Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOLTT8Qmo31YExXUOPk2sx73b734wuxiD3AUX0UAnPo9WSqpfQ@mail.gmail.com \
--to=adlternative@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=zegerjan@gitlab.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).