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

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

Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 74 of 86 in “fetch: add --must-have and remote.*.mustHave”
  1. 0/4 fetch: add --must-have and remote.*.mustHaveDerrick Stolee via GitGitGadget, Apr 8, 2026
  2. 1/4 t5516: fix test order flakinessDerrick Stolee via GitGitGadget, Apr 8, 2026
  3. 2/4 fetch: add --must-have option for negotiationDerrick Stolee via GitGitGadget, Apr 8, 2026
  4. 3/4 remote: add mustHave config as default for --must-haveDerrick Stolee via GitGitGadget, Apr 8, 2026
  5. 4/4 send-pack: pass --must-have for push negotiationDerrick Stolee via GitGitGadget, Apr 8, 2026
  6. Junio C HamanoApr 8, 2026
  7. Derrick StoleeApr 9, 2026
  8. 0/7 fetch: rework negotiation tip optionsDerrick Stolee via GitGitGadget, Apr 15, 2026
  9. 1/7 t5516: fix test order flakinessDerrick Stolee via GitGitGadget, Apr 15, 2026
  10. 2/7 fetch: add --negotiation-restrict optionDerrick Stolee via GitGitGadget, Apr 15, 2026
  11. Junio C HamanoApr 15, 2026
  12. Derrick StoleeApr 19, 2026
  13. Junio C HamanoApr 20, 2026
  14. Derrick StoleeApr 20, 2026
  15. 3/7 transport: rename negotiation_tipsDerrick Stolee via GitGitGadget, Apr 15, 2026
  16. Patrick SteinhardtApr 20, 2026
  17. 4/7 remote: add remote.*.negotiationRestrict configDerrick Stolee via GitGitGadget, Apr 15, 2026
  18. Junio C HamanoApr 15, 2026
  19. 5/7 fetch: add --negotiation-require option for negotiationDerrick Stolee via GitGitGadget, Apr 15, 2026
  20. Junio C HamanoApr 15, 2026
  21. Derrick StoleeApr 21, 2026
  22. Patrick SteinhardtApr 20, 2026
  23. Derrick StoleeApr 20, 2026
  24. 6/7 remote: add negotiationRequire config as default for --negotiation-requireDerrick Stolee via GitGitGadget, Apr 15, 2026
  25. 7/7 send-pack: pass negotiation config in pushDerrick Stolee via GitGitGadget, Apr 15, 2026
  26. 0/7 fetch: rework negotiation tip optionsDerrick Stolee via GitGitGadget, Apr 22, 2026
  27. 1/7 t5516: fix test order flakinessDerrick Stolee via GitGitGadget, Apr 22, 2026
  28. Matthew John CheethamMay 12, 2026
  29. 2/7 fetch: add --negotiation-restrict optionDerrick Stolee via GitGitGadget, Apr 22, 2026
  30. Matthew John CheethamMay 12, 2026
  31. Derrick StoleeMay 12, 2026
  32. 3/7 transport: rename negotiation_tipsDerrick Stolee via GitGitGadget, Apr 22, 2026
  33. Matthew John CheethamMay 12, 2026
  34. Derrick StoleeMay 12, 2026
  35. 4/7 remote: add remote.*.negotiationRestrict configDerrick Stolee via GitGitGadget, Apr 22, 2026
  36. Matthew John CheethamMay 12, 2026
  37. Derrick StoleeMay 12, 2026
  38. 5/7 fetch: add --negotiation-include option for negotiationDerrick Stolee via GitGitGadget, Apr 22, 2026
  39. Matthew John CheethamMay 12, 2026
  40. Derrick StoleeMay 12, 2026
  41. 6/7 remote: add remote.*.negotiationInclude configDerrick Stolee via GitGitGadget, Apr 22, 2026
  42. Matthew John CheethamMay 12, 2026
  43. Derrick StoleeMay 12, 2026
  44. 7/7 send-pack: pass negotiation config in pushDerrick Stolee via GitGitGadget, Apr 22, 2026
  45. Matthew John CheethamMay 12, 2026
  46. 0/8 fetch: rework negotiation tip optionsDerrick Stolee via GitGitGadget, May 14, 2026
  47. 1/8 t5516: fix test order flakinessDerrick Stolee via GitGitGadget, May 14, 2026
  48. Matthew John CheethamMay 18, 2026
  49. 2/8 fetch: add --negotiation-restrict optionDerrick Stolee via GitGitGadget, May 14, 2026
  50. Matthew John CheethamMay 18, 2026
  51. 3/8 transport: rename negotiation_tipsDerrick Stolee via GitGitGadget, May 14, 2026
  52. Matthew John CheethamMay 18, 2026
  53. 4/8 remote: add remote.*.negotiationRestrict configDerrick Stolee via GitGitGadget, May 14, 2026
  54. Matthew John CheethamMay 18, 2026
  55. 5/8 negotiator: add have_sent() interfaceDerrick Stolee via GitGitGadget, May 14, 2026
  56. Matthew John CheethamMay 18, 2026
  57. 6/8 fetch: add --negotiation-include option for negotiationDerrick Stolee via GitGitGadget, May 14, 2026
  58. Matthew John CheethamMay 18, 2026
  59. 7/8 remote: add remote.*.negotiationInclude configDerrick Stolee via GitGitGadget, May 14, 2026
  60. Matthew John CheethamMay 18, 2026
  61. 8/8 send-pack: pass negotiation config in pushDerrick Stolee via GitGitGadget, May 14, 2026
  62. Matthew John CheethamMay 18, 2026
  63. Matthew John CheethamMay 18, 2026
  64. Derrick StoleeMay 18, 2026
  65. 0/8 fetch: rework negotiation tip optionsDerrick Stolee via GitGitGadget, May 18, 2026
  66. 2/8 fetch: add --negotiation-restrict optionDerrick Stolee via GitGitGadget, May 18, 2026
  67. 3/8 transport: rename negotiation_tipsDerrick Stolee via GitGitGadget, May 18, 2026
  68. 4/8 remote: add remote.*.negotiationRestrict configDerrick Stolee via GitGitGadget, May 18, 2026
  69. 5/8 negotiator: add have_sent() interfaceDerrick Stolee via GitGitGadget, May 18, 2026
  70. 6/8 fetch: add --negotiation-include option for negotiationDerrick Stolee via GitGitGadget, May 18, 2026
  71. 7/8 remote: add remote.*.negotiationInclude configDerrick Stolee via GitGitGadget, May 18, 2026
  72. 8/8 send-pack: pass negotiation config in pushDerrick Stolee via GitGitGadget, May 18, 2026
  73. 1/8 t5516: fix test order flakinessDerrick Stolee via GitGitGadget, May 18, 2026
  74. Matthew John CheethamMay 19, 2026
  75. Derrick StoleeMay 19, 2026
  76. 0/8 fetch: rework negotiation tip optionsDerrick Stolee via GitGitGadget, May 19, 2026
  77. 1/8 t5516: fix test order flakinessDerrick Stolee via GitGitGadget, May 19, 2026
  78. 2/8 fetch: add --negotiation-restrict optionDerrick Stolee via GitGitGadget, May 19, 2026
  79. 3/8 transport: rename negotiation_tipsDerrick Stolee via GitGitGadget, May 19, 2026
  80. 4/8 remote: add remote.*.negotiationRestrict configDerrick Stolee via GitGitGadget, May 19, 2026
  81. 5/8 negotiator: add have_sent() interfaceDerrick Stolee via GitGitGadget, May 19, 2026
  82. 6/8 fetch: add --negotiation-include option for negotiationDerrick Stolee via GitGitGadget, May 19, 2026
  83. 7/8 remote: add remote.*.negotiationInclude configDerrick Stolee via GitGitGadget, May 19, 2026
  84. 8/8 send-pack: pass negotiation config in pushDerrick Stolee via GitGitGadget, May 19, 2026
  85. Matthew John CheethamMay 19, 2026
  86. Junio C HamanoMay 20, 2026

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.