Re: [PATCH v5 0/8] fetch: rework negotiation tip options
- From
Matthew John Cheetham <mjcheetham@outlook.com>
- Date
- May 19, 2026, 09:13 UTC
- Message-ID
- <VI0PR03MB11634DBCD7ED97E3358AC9339C0002@VI0PR03MB11634.eurprd03.prod.outlook.com>
- In-Reply-To
- <pull.2085.v5.git.1779135575.gitgitgadget@gmail.com>
On 2026-05-18 21:19, Derrick Stolee via GitGitGadget wrote:
Show 9 quoted lines
> Range-diff vs v4: > > 1: 7409a479d6 ! 1: 538913a327 t5516: fix test order flakiness > @@ Commit message > > Use 'sort -k 3' to match the actual number of columns in the output. > > + Reviewed-by: Matthew John Cheetham <mcheetham@outlook.com> > Signed-off-by: Derrick Stolee <stolee@gmail.com>
mjcheetham@outlook.com, not mcheetham@outlook.com.
Show 62 quoted lines
> 6: b4cd458fe0 ! 6: e86c9791e2 fetch: add --negotiation-include option for negotiation
> @@ Commit message
>
> Also add --negotiation-include to 'git pull' passthrough options.
>
> + Reviewed-by: Matthew John Cheetham <mcheetham@outlook.com>
> Signed-off-by: Derrick Stolee <stolee@gmail.com>
>
> ## Documentation/fetch-options.adoc ##
> @@ builtin/fetch.c: static int add_oid(const struct reference *ref, void *cb_data)
>
> -static void add_negotiation_restrict_tips(struct git_transport_options *smart_options)
> +static void add_negotiation_tips(struct string_list *input_list,
> -+ struct oid_array **output_list)
> ++ struct oid_array **output_list,
> ++ const char *argname)
> {
> struct oid_array *oids = xcalloc(1, sizeof(*oids));
> int i;
> @@ builtin/fetch.c: static int add_oid(const struct reference *ref, void *cb_data)
> continue;
> }
> @@ builtin/fetch.c: static void add_negotiation_restrict_tips(struct git_transport_options *smart_op
> + add_oid, oids, &opts);
> + if (old_nr == oids->nr)
> warning(_("ignoring %s=%s because it does not match any refs"),
> - "--negotiation-restrict", s);
> +- "--negotiation-restrict", s);
> ++ argname, s);
> }
> - smart_options->negotiation_restrict_tips = oids;
> + *output_list = oids;
> @@ builtin/fetch.c: static struct transport *prepare_transport(struct remote *remot
> if (transport->smart_options)
> - add_negotiation_restrict_tips(transport->smart_options);
> + add_negotiation_tips(&negotiation_restrict,
> -+ &transport->smart_options->negotiation_restrict_tips);
> ++ &transport->smart_options->negotiation_restrict_tips,
> ++ "--negotiation-restrict");
> else
> warning(_("ignoring %s because the protocol does not support it"),
> "--negotiation-restrict");
> @@ builtin/fetch.c: static struct transport *prepare_transport(struct remote *remot
> if (transport->smart_options)
> - add_negotiation_restrict_tips(transport->smart_options);
> + add_negotiation_tips(&negotiation_restrict,
> -+ &transport->smart_options->negotiation_restrict_tips);
> ++ &transport->smart_options->negotiation_restrict_tips,
> ++ "--negotiation-restrict");
> else {
> struct strbuf config_name = STRBUF_INIT;
> strbuf_addf(&config_name, "remote.%s.negotiationRestrict", remote->name);
> @@ builtin/fetch.c: static struct transport *prepare_transport(struct remote *remot
> + if (negotiation_include.nr) {
> + if (transport->smart_options)
> + add_negotiation_tips(&negotiation_include,
> -+ &transport->smart_options->negotiation_include_tips);
> ++ &transport->smart_options->negotiation_include_tips,
> ++ "--negotiation-include");
> + else
> + warning(_("ignoring %s because the protocol does not support it"),
> + "--negotiation-include");Perfect!
Show 21 quoted lines
> @@ Documentation/config/remote.adoc: values are not used.
> +This option is additive with the normal negotiation process: the
> +negotiation algorithm still runs and advertises its own selected commits,
> +but the refs matching `remote.<name>.negotiationInclude` are sent
> -+unconditionally on top of those heuristically selected commits. This
> -+option is also used during push negotiation when `push.negotiate` is
> -+enabled.
> ++unconditionally on top of those heuristically selected commits.
> ++
> +Blank values signal to ignore all previous values, allowing a reset of
> +the list from broader config scenarios.
> @@ builtin/fetch.c: static struct transport *prepare_transport(struct remote *remot
> + } else if (remote->negotiation_include.nr) {
> + if (transport->smart_options) {
> + add_negotiation_tips(&remote->negotiation_include,
> -+ &transport->smart_options->negotiation_include_tips);
> ++ &transport->smart_options->negotiation_include_tips,
> ++ "--negotiation-include");
> + } else {
> + struct strbuf config_name = STRBUF_INIT;
> + strbuf_addf(&config_name, "remote.%s.negotiationInclude", remote->name);Great
Show 26 quoted lines
> 8: 5b968245eb ! 8: ed0be32e2c send-pack: pass negotiation config in push > @@ Commit message > are passed as --negotiation-include to ensure their tips are always > sent as 'have' lines during push negotiation. > > - This change also updates the use of --negotiation-tip into > - --negotiation-restrict now that the new synonym exists. > - > + Reviewed-by: Matthew John Cheetham <mcheetham@outlook.com> > Signed-off-by: Derrick Stolee <stolee@gmail.com> > > ## Documentation/config/remote.adoc ## > @@ Documentation/config/remote.adoc: command-line option. If `--negotiation-restri > Blank values signal to ignore all previous values, allowing a reset of > the list from broader config scenarios. > > -@@ Documentation/config/remote.adoc: unconditionally on top of those heuristically selected commits. This > - option is also used during push negotiation when `push.negotiate` is > - enabled. > +@@ Documentation/config/remote.adoc: negotiation algorithm still runs and advertises its own selected commits, > + but the refs matching `remote.<name>.negotiationInclude` are sent > + unconditionally on top of those heuristically selected commits. > + > +These values also influence negotiation during `git push` if > +`push.negotiate` is enabled. >
LGTM
Thanks, Matthew