Git development
 help / color / mirror / Atom feed
From: "Saagar Jha via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Pablo <pabloosabaterr@gmail.com>,
	Saagar Jha <saagar@saagarjha.com>,
	Saagar Jha <saagar@saagarjha.com>
Subject: [PATCH v4] submodule-config: fix reading submodule.fetchJobs
Date: Sun, 10 May 2026 03:50:22 +0000	[thread overview]
Message-ID: <pull.2287.v4.git.git.1778385022964.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2287.v3.git.git.1777816327842.gitgitgadget@gmail.com>

From: Saagar Jha <saagar@saagarjha.com>

update_clone_config_from_gitmodules() passes &max_jobs to
config_from_gitmodules(), but max_jobs is already a pointer. This causes
the config value to be written to the wrong address and get dropped.

Pass max_jobs directly.

Signed-off-by: Saagar Jha <saagar@saagarjha.com>
---
    submodule-config: fix reading submodule.fetchJobs

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2287%2Fsaagarjha%2Fmaint-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2287/saagarjha/maint-v4
Pull-Request: https://github.com/git/git/pull/2287

Range-diff vs v3:

 1:  70fb2ede0f ! 1:  415c17f4bb submodule-config: fix reading submodule.fetchJobs
     @@ t/t7406-submodule-update.sh: test_expect_success 'submodule update can be run in
      +test_expect_success 'submodule update honors fetch jobs config from .gitmodules' '
      +	test_when_finished "rm -rf super3" &&
      +	git clone cloned super3 &&
     -+	(cd super3 &&
     -+	 git config -f .gitmodules submodule.fetchJobs 67 &&
     -+	 GIT_TRACE="$(pwd)/trace.out" git submodule update --init &&
     -+	 grep "67 tasks" trace.out
     -+	)
     ++	git -C super3 config -f .gitmodules submodule.fetchJobs 67 &&
     ++	GIT_TRACE="$(pwd)/trace.out" git -C super3 submodule update --init &&
     ++	test_grep "67 tasks" trace.out
      +'
      +
       test_expect_success 'git clone passes the parallel jobs config on to submodules' '


 submodule-config.c          | 2 +-
 t/t7406-submodule-update.sh | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/submodule-config.c b/submodule-config.c
index 1f19fe2077..57b190678e 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -1037,5 +1037,5 @@ static int gitmodules_update_clone_config(const char *var, const char *value,
 
 void update_clone_config_from_gitmodules(int *max_jobs)
 {
-	config_from_gitmodules(gitmodules_update_clone_config, the_repository, &max_jobs);
+	config_from_gitmodules(gitmodules_update_clone_config, the_repository, max_jobs);
 }
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 3adab12091..6abb00876a 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -1055,6 +1055,14 @@ test_expect_success 'submodule update can be run in parallel' '
 	)
 '
 
+test_expect_success 'submodule update honors fetch jobs config from .gitmodules' '
+	test_when_finished "rm -rf super3" &&
+	git clone cloned super3 &&
+	git -C super3 config -f .gitmodules submodule.fetchJobs 67 &&
+	GIT_TRACE="$(pwd)/trace.out" git -C super3 submodule update --init &&
+	test_grep "67 tasks" trace.out
+'
+
 test_expect_success 'git clone passes the parallel jobs config on to submodules' '
 	test_when_finished "rm -rf super4" &&
 	GIT_TRACE=$(pwd)/trace.out git clone --recurse-submodules --jobs 7 . super4 &&

base-commit: 67ad42147a7acc2af6074753ebd03d904476118f
-- 
gitgitgadget

      reply	other threads:[~2026-05-10  3:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03 10:14 [PATCH] submodule-config: fix reading submodule.fetchJobs Saagar Jha via GitGitGadget
2026-05-03 11:07 ` Pablo
2026-05-03 11:24   ` Saagar Jha
2026-05-03 12:19     ` Pablo
2026-05-03 11:57 ` [PATCH v2] " Saagar Jha via GitGitGadget
2026-05-03 13:07   ` Pablo
2026-05-10  0:01     ` Junio C Hamano
2026-05-03 13:52   ` [PATCH v3] " Saagar Jha via GitGitGadget
2026-05-10  3:50     ` Saagar Jha via GitGitGadget [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

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

  git send-email \
    --in-reply-to=pull.2287.v4.git.git.1778385022964.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pabloosabaterr@gmail.com \
    --cc=saagar@saagarjha.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox