All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>,
	 Matt Cote <mcote@nvidia.com>
Subject: Re: [PATCH 1/3] connect: let write_command_and_capabilities() send a promisor-remote reply
Date: Thu, 12 Nov 2026 14:34:38 -0800	[thread overview]
Message-ID: <xmqq4idlhe69.fsf@gitster.g> (raw)
In-Reply-To: <xmqq8q2xhexs.fsf@gitster.g> (Junio C. Hamano's message of "Thu, 12 Nov 2026 14:18:07 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Christian Couder <christian.couder@gmail.com> writes:
>
>>  void write_command_and_capabilities(struct strbuf *req_buf, const char *command,
>> -				    const struct string_list *server_options)
>> +				    const struct string_list *server_options,
>> +				    const char *promisor_remote_reply)
>>  {
>>  	const char *hash_name;
>>  	int advertise_sid = 0;
>> @@ -754,6 +755,9 @@ void write_command_and_capabilities(struct strbuf *req_buf, const char *command,
>>  		die(_("the server does not support algorithm '%s'"),
>>  		    the_hash_algo->name);
>>  	}
>> +	if (promisor_remote_reply)
>> +		packet_buf_write(req_buf, "promisor-remote=%s",
>> +				 promisor_remote_reply);
>>  	packet_buf_delim(req_buf);
>>  }
>
> This function was designed to have a fairly generic "here we send a
> command and then capability exchange based on the settings stored in
> the string list" interface for extensibility.  It is highly annoying
> that we are now adding a specific option here to be sent outside the
> framework.
>
> Isn't the misdesign being corrected that the "promisor-remote=..."
> string was not sent as part of these server options list of strings?
> Can we fix it without contaminating the API like this patch does, or
> is it too late?

By this I do not mean that promisor-remote=... has to be sent as one
of the server options (i.e., making the string sent to something
silly like "server-option=promisor-remote=...").  Rather, I am
wondering if the existing server_options string list should be made
into a more generalized form so that the string list can contain
elements whose keys other than "server-option" can also be
contained (like "promisor-remote").  IOW, the caller can decide to
put "promisor-remote=...promisor remote reply..." in the list,
instead of sending it as a totally separate parameter, whose
semantics is hardcoded (i.e. the fourth parameter to this function
will be sent as a value to "promistor-remote=...").



  reply	other threads:[~2026-11-12 22:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 19:58 [PATCH 0/3] Fix promisor-remote reply missing from fetch Christian Couder
2026-11-12 19:59 ` [PATCH 1/3] connect: let write_command_and_capabilities() send a promisor-remote reply Christian Couder
2026-11-12 22:18   ` Junio C Hamano
2026-11-12 22:34     ` Junio C Hamano [this message]
2026-11-12 19:59 ` [PATCH 2/3] fetch-pack: ensure fetch sends " Christian Couder
2026-11-12 19:59 ` [PATCH 3/3] doc: gitprotocol-v2: send the promisor-remote reply with fetch Christian Couder

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=xmqq4idlhe69.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mcote@nvidia.com \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.