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

Re: [PATCH v3 1/3] repo-settings: fix checking for fetch.negotiationAlgorithm=default

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 1, 2022, 18:21 UTC
Message-ID
<xmqq4k5ifnxg.fsf@gitster.g>
In-Reply-To
<df0ec5ffe98a17e1ec7b572085e733d8748c0379.1643734828.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 11 quoted lines
> diff --git a/repo-settings.c b/repo-settings.c
> index 00ca5571a1a..38c10f9977b 100644
> --- a/repo-settings.c
> +++ b/repo-settings.c
> @@ -85,6 +85,8 @@ void prepare_repo_settings(struct repository *r)
>  			r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
>  		else if (!strcasecmp(strval, "noop"))
>  			r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP;
> +		else if (!strcasecmp(strval, "default"))
> +			r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;
>  	}
After this step, this function does:
 * fetch_negotiation_algorithm set to _DEFAULT
 * experimental bit flips it to _SKIPPING
 * config is read and skipping/noop/default overwrites it.

which is better than ignoring "default", but it strikes me as unnatural. If it were done like this instead:

 * fetch_negotiation_algorithm is set to _DEFAULT
 * config is read and skipping/noop/default overwrites it.
 * experimental bit flips it to _SKIPPING only when it is still _DEFAULT
this bug wouldn't have happened, I suspect.

More importantly, those who want to say "I want to keep up with the 'possible future default', which is appropriately chosen by Git for opt-in experimenters" by setting feature.experimental to true, would be able to do so when the flow is reordered like so.

Setting fetch.negotiationAlgorithm=default would be the way to do so.

Let's read on and see later steps of this series achieves the same. Perhaps they may do the same reordering.

Thanks.
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren via GitGitGadget
Message 14 of 23 in “repo-settings: fix checking for fetch.negotiationAlgorithm=default”
  1. repo-settings: fix checking for fetch.negotiationAlgorithm=defaultElijah Newren via GitGitGadget, Jan 28, 2022
  2. Ævar Arnfjörð BjarmasonJan 28, 2022
  3. Elijah NewrenJan 29, 2022
  4. Ævar Arnfjörð BjarmasonJan 29, 2022
  5. Junio C HamanoJan 31, 2022
  6. Elijah NewrenJan 31, 2022
  7. Ævar Arnfjörð BjarmasonJan 31, 2022
  8. Elijah NewrenJan 31, 2022
  9. Jonathan TanFeb 1, 2022
  10. Junio C HamanoJan 31, 2022
  11. repo-settings: fix checking for fetch.negotiationAlgorithm=defaultElijah Newren via GitGitGadget, Jan 29, 2022
  12. 0/3 repo-settings: fix checking for fetch.negotiationAlgorithm=defaultElijah Newren via GitGitGadget, Feb 1, 2022
  13. 1/3 repo-settings: fix checking for fetch.negotiationAlgorithm=defaultElijah Newren via GitGitGadget, Feb 1, 2022
  14. Junio C HamanoFeb 1, 2022
  15. 2/3 repo-settings: fix error handling for unknown valuesElijah Newren via GitGitGadget, Feb 1, 2022
  16. Junio C HamanoFeb 1, 2022
  17. 3/3 repo-settings: name the default fetch.negotiationAlgorithm 'consecutive'Elijah Newren via GitGitGadget, Feb 1, 2022
  18. Junio C HamanoFeb 1, 2022
  19. 0/3 repo-settings: fix checking for fetch.negotiationAlgorithm=defaultElijah Newren via GitGitGadget, Feb 2, 2022
  20. 1/3 repo-settings: fix checking for fetch.negotiationAlgorithm=defaultElijah Newren via GitGitGadget, Feb 2, 2022
  21. 2/3 repo-settings: fix error handling for unknown valuesElijah Newren via GitGitGadget, Feb 2, 2022
  22. 3/3 repo-settings: rename the traditional default fetch.negotiationAlgorithmElijah Newren via GitGitGadget, Feb 2, 2022
  23. Junio C HamanoFeb 2, 2022

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.