git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH] fetch: return when parsing submodule.recurse
Date: Fri, 05 Apr 2024 09:53:43 -0700	[thread overview]
Message-ID: <xmqqbk6nwy20.fsf@gitster.g> (raw)
In-Reply-To: <pull.1709.git.1712285542303.gitgitgadget@gmail.com> (Derrick Stolee via GitGitGadget's message of "Fri, 05 Apr 2024 02:52:22 +0000")

"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Derrick Stolee <stolee@gmail.com>
>
> When parsing config keys, the normal pattern is to return 0 after
> completing the logic for a specific config key, since no other key will
> match. One instance, for "submodule.recurse", was missing this case in
> builtin/fetch.c.
>
> This is a very minor change, and will have minimal impact to
> performance.

True, and the performance impact should be positive, if it is
observable.

Well spotted.  Thanks.

> This particular block was edited recently in 56e8bb4fb4
> (fetch: use `fetch_config` to store "fetch.recurseSubmodules" value,
> 2023-05-17), which led to some hesitation that perhaps this omission was
> on purpose.
>
> However, no later cases within git_fetch_config() will match the key if
> equal to "submodule.recurse" and neither will any key matches within the
> catch-all git_default_config().
>
> Signed-off-by: Derrick Stolee <stolee@gmail.com>
> ---
>     fetch: return when parsing submodule.recurse
>     
>     This is a super-nit that I noticed when looking into this config setting
>     and couldn't help but try to fix.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1709%2Fderrickstolee%2Ffetch-config-parse-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1709/derrickstolee/fetch-config-parse-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1709
>
>  builtin/fetch.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 46a793411a4..5857d860dbf 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -138,6 +138,7 @@ static int git_fetch_config(const char *k, const char *v,
>  		int r = git_config_bool(k, v) ?
>  			RECURSE_SUBMODULES_ON : RECURSE_SUBMODULES_OFF;
>  		fetch_config->recurse_submodules = r;
> +		return 0;
>  	}
>  
>  	if (!strcmp(k, "submodule.fetchjobs")) {
>
> base-commit: 7774cfed6261ce2900c84e55906da708c711d601


      reply	other threads:[~2024-04-05 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  2:52 [PATCH] fetch: return when parsing submodule.recurse Derrick Stolee via GitGitGadget
2024-04-05 16:53 ` Junio C Hamano [this message]

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=xmqqbk6nwy20.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=stolee@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).