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

[PATCH 0/2] clone, fetch: reject a negative --jobs

From
AAAbhishek Agarwal <agab0323@gmail.com>
Date
Dec 2, 2026, 17:13 UTC
Message-ID
<20261202171328.805150-1-agab0323@gmail.com>

In the review of aa/submodule-update-jobs [1], Junio pointed out that "git clone --recurse-submodules --jobs=-1" is ignored without a word, because clone uses -1 to mean "not given" and does not pass it on, while "--jobs=-2" is passed on and only rejected by "submodule update" after the clone is done. He wondered if "fetch" has a similar issue. It does: "git fetch" and "git pull" treat any negative "--jobs" as if the option was not given.

These two patches make both commands reject a negative value while the command line is parsed, with the same message "submodule update" now gives. The series is built on top of aa/submodule-update-jobs, because the first patch adds its test next to the tests from that topic.

Two things I was not sure about:
 - Both patches add the same small callback. I kept a copy in each
   command so that the two stay independent, but I can move it to
   parse-options-cb.c if that is preferred.
 - "git hook run -j-1" uses -1 to mean "all CPUs" (495b7d54dc). I did
   not do that here, because the configuration variables clone and
   fetch fall back to (submodule.fetchJobs and fetch.parallel) reject
   negative values and use 0 for "all CPUs", and so does "submodule
   update --jobs" after the topic above.
[1] https://lore.kernel.org/git/xmqqtsl4zlyl.fsf@gitster.g/
Abhishek Agarwal (2):
  clone: reject a negative --jobs before cloning
  fetch: reject a negative --jobs
 builtin/clone.c             | 18 ++++++++++++++++--
 builtin/fetch.c             | 18 ++++++++++++++++--
 t/t5514-fetch-multiple.sh   |  8 ++++++++
 t/t7406-submodule-update.sh | 10 ++++++++++
 4 files changed, 50 insertions(+), 4 deletions(-)
base-commit: 5d6ad3960bf5d6e577b706d8c642429b504b065d
-- 
2.56.0
Next: Abhishek Agarwal
Message 1 of 5 in “clone, fetch: reject a negative --jobs”
  1. 0/2 clone, fetch: reject a negative --jobsAbhishek Agarwal, Dec 2, 2026
  2. 1/2 clone: reject a negative --jobs before cloningAbhishek Agarwal, Dec 2, 2026
  3. Patrick SteinhardtDec 3, 2026
  4. 2/2 fetch: reject a negative --jobsAbhishek Agarwal, Dec 2, 2026
  5. Patrick SteinhardtDec 3, 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.