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

Re: [PATCH] doc: fetch: document `--jobs=0` behavior

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 2, 2026, 19:33 UTC
Message-ID
<xmqqo6l6yqkp.fsf@gitster.g>
In-Reply-To
<25715312-b6a0-0cdd-d62c-3a4a840b0244@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 21 quoted lines
>> Dscho, do you remember by chance why you decided to not be more specific
>> here?
>
> Unfortunately not.
>
> So I went on reconstructing the lay of the land back when d54dea77dba
> (fetch: let --jobs=<n> parallelize --multiple, too, 2019-10-05) landed.
> With that commit, the `max_children` variable (which `--jobs=0` would set
> to 0) would be passed via `fetch_multiple()` [*1*] or
> `fetch_populated_submodules()` [*2*] to `run_processes_parallel_tr2()`,
> which would pass it through to `run_processes_parallel()` as the first
> parameter (called `n`) [*3*]. That function would pass that variable to
> `pp_init()` first thing [*4*], which would fall back to `online_cpus()` if
> it saw a value smaller than 1 [*5*].
>
> So: The "reasonable default" is the number of CPUs, or more correctly, of
> CPU cores. It does seem, though, that that was considered common knowledge
> at the time, given e.g. v2.40.0's release notes saying [*6*]:
>
>   "git fetch --jobs=0" used to hit a BUG(), which has been corrected
>   to use the available CPUs.

The belief that "available CPU cores is a reasonable default" turns out to be older than that.

Back in the days we didn't thread iterations of the same topic properly, so visiting the discussion thread and trying to find older iterations of the same topic was a nightmare, but I think I found where the phrasing came from:

https://lore.kernel.org/git/1446074504-6014-6-git-send-email-sbeller@google.com/

This is a step in the second iteration of fetching submodules in parallel topic from 28 Oct 2015, where "some reasonable default" appears. I think it was done in response to a review comment on its earlier iteration which was:

https://lore.kernel.org/git/xmqqio5sni1j.fsf@gitster.mtv.corp.google.com/

Later the work resulted in a028a193 (fetching submodules: respect `submodule.fetchJobs` config option, 2016-02-29).

https://lore.kernel.org/git/1456798040-30129-4-git-send-email-sbeller@google.com/

The variable fetch.parallel did not exist until d54dea77 (fetch: let --jobs=<n> parallelize --multiple, too, 2019-10-05) copied the famous "some reasonable default" phrasing to its documentation.

Previous: Johannes SchindelinNext: Junio C Hamano
Message 7 of 8 in “doc: fetch: document `--jobs=0` behavior”
  1. doc: fetch: document `--jobs=0` behaviorDaniel D. Beck via GitGitGadget, Feb 18, 2026
  2. Patrick SteinhardtFeb 19, 2026
  3. Junio C HamanoFeb 19, 2026
  4. Patrick SteinhardtFeb 20, 2026
  5. Daniel BeckFeb 24, 2026
  6. Johannes SchindelinMar 2, 2026
  7. Junio C HamanoMar 2, 2026
  8. Junio C HamanoFeb 19, 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.