git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Derrick Stolee" <dstolee@microsoft.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Elijah Newren" <newren@gmail.com>
Subject: Re: [PATCH v3 3/3] repo-settings: name the default fetch.negotiationAlgorithm 'consecutive'
Date: Tue, 01 Feb 2022 10:35:18 -0800	[thread overview]
Message-ID: <xmqqleyue8pl.fsf@gitster.g> (raw)
In-Reply-To: <7b28c527a907c81c3d3d8a6a54d5c713cef4f2a0.1643734828.git.gitgitgadget@gmail.com> (Elijah Newren via GitGitGadget's message of "Tue, 01 Feb 2022 17:00:28 +0000")

"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Elijah Newren <newren@gmail.com>
>
> Give the default fetch.negotiationAlgorithm the name 'consecutive' and
> update the documentation accordingly.  Since there may be some users
> using the name 'default' for this behavior, retain that name for now.
> We do not want to use that name indefinitely, though, because if
> 'skipping' becomes the default, then the "default" behavior will not be
> the default behavior, which would be confusing.

This is probably where we still disagree after the review exchange
for the previous round.

I view the act of setting this variable to 'default' by the user as
saying "let Git choose whatever is appropriate for me, which may
change over time as the Git project gains more insight".  In that
world view, 'default' that changes the behaviour with newer versions
of Git, or when 'feature.experimental' is set/unset, is a desirable
outcome.

>  fetch.negotiationAlgorithm::
> +	Control how information about the commits in the local repository
> +	is sent when negotiating the contents of the packfile to be sent by
> +	the server.  Set to "consecutive" to use an algorithm that walks
> +	over consecutive commits checking each one.  Set to "skipping" to
> +	use an algorithm that skips commits in an effort to converge
> +	faster, but may result in a larger-than-necessary packfile; or set
> +	to "noop" to not send any information at all, which will almost
> +	certainly result in a larger-than-necessary packfile, but will skip
> +	the negotiation step.  The default is normally "consecutive", but
> +	if `feature.experimental` is true, then the default is "skipping".

So, in my worldview, this statement is needed:

    Set to "default" to override settings made previously and use
    the default behaviour.

but of course if you do not want to allow a "dear Git, please choose
for me appropriately" setting, such a statement contradicts with it.

And with the design in the patch, next person who notices the code
accepts another value that is not documented will suggest an update
to the documentation:

    The default is "consecutive" but "skipping" is used when
    feature.experimental is set.  Setting it to "default" is the
    same as setting it to "consecutive".

which looks quite confusing, no?

> diff --git a/repo-settings.c b/repo-settings.c
> index 41e1c30845f..e984075df12 100644
> --- a/repo-settings.c
> +++ b/repo-settings.c
> @@ -26,7 +26,7 @@ void prepare_repo_settings(struct repository *r)
>  	/* Defaults */
>  	r->settings.index_version = -1;
>  	r->settings.core_untracked_cache = UNTRACKED_CACHE_KEEP;
> -	r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;
> +	r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE;
>  
>  	/* Booleans config or default, cascades to other settings */
>  	repo_cfg_bool(r, "feature.manyfiles", &manyfiles, 0);
> @@ -85,8 +85,9 @@ 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;
> +		else if (!strcasecmp(strval, "consecutive") ||
> +			 !strcasecmp(strval, "default"))
> +			r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE;
>  		else
>  			die("unknown fetch negotiation algorithm '%s'", strval);
>  	}

So, I am not sure this is a good idea.

  reply	other threads:[~2022-02-01 18:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  1:56 [PATCH] repo-settings: fix checking for fetch.negotiationAlgorithm=default Elijah Newren via GitGitGadget
2022-01-28  7:25 ` Ævar Arnfjörð Bjarmason
2022-01-29  1:40   ` Elijah Newren
2022-01-29  6:08     ` Ævar Arnfjörð Bjarmason
2022-01-31 16:57     ` Junio C Hamano
2022-01-31 17:33       ` Elijah Newren
2022-01-31 21:03         ` Ævar Arnfjörð Bjarmason
2022-01-31 21:47           ` Elijah Newren
2022-02-01 17:37             ` Jonathan Tan
2022-01-31 22:06           ` Junio C Hamano
2022-01-29 17:51 ` [PATCH v2] " Elijah Newren via GitGitGadget
2022-02-01 17:00   ` [PATCH v3 0/3] " Elijah Newren via GitGitGadget
2022-02-01 17:00     ` [PATCH v3 1/3] " Elijah Newren via GitGitGadget
2022-02-01 18:21       ` Junio C Hamano
2022-02-01 17:00     ` [PATCH v3 2/3] repo-settings: fix error handling for unknown values Elijah Newren via GitGitGadget
2022-02-01 18:21       ` Junio C Hamano
2022-02-01 17:00     ` [PATCH v3 3/3] repo-settings: name the default fetch.negotiationAlgorithm 'consecutive' Elijah Newren via GitGitGadget
2022-02-01 18:35       ` Junio C Hamano [this message]
2022-02-02  3:42     ` [PATCH v4 0/3] repo-settings: fix checking for fetch.negotiationAlgorithm=default Elijah Newren via GitGitGadget
2022-02-02  3:42       ` [PATCH v4 1/3] " Elijah Newren via GitGitGadget
2022-02-02  3:42       ` [PATCH v4 2/3] repo-settings: fix error handling for unknown values Elijah Newren via GitGitGadget
2022-02-02  3:42       ` [PATCH v4 3/3] repo-settings: rename the traditional default fetch.negotiationAlgorithm Elijah Newren via GitGitGadget
2022-02-02 17:50         ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqleyue8pl.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).