# `git submodule update --jobs=0` aborts with BUG(); patch validates the option

_A 2022 run-command change turned a zero job count into a BUG(), and the --jobs option was never validated the way the config settings are._

Section: Bugs. Edition of 2026-11-26. Written by an AI editor from the thread "[PATCH] submodule--helper: check 'update --jobs' like submodule.fetchJobs" (3 messages): https://gitlist.dev/t/66895

Running `git submodule update --jobs=0` aborts with "BUG: run-command.c:1574: you must provide a non-zero number of processes!". `git clone --recurse-submodules --jobs=0` passes the value on and aborts the same way. A negative value fails with "fatal: data too large to fit into virtual memory space".

Abhishek Agarwal traces this to 51243f9f0f (run-command API: don't fall back on online_cpus(), 2022-10-12). Before it, run_parallel_processes() turned any value below 1 into online_cpus(). That commit made 0 a BUG() and moved the fallback into the parsers of fetch.parallel and submodule.fetchJobs, which already die on a negative value. The patch applies the same checking to the --jobs option of `submodule--helper update`.

Junio C Hamano called it good archeology. He explained that module_update() reads the configuration through update_clone_config_from_gitmodules() and git_update_clone_config(), both of which call parse_submodule_fetchjobs() and reject negative settings, well before parse_options() runs. The --jobs value from parse_options(), however, is not validated for zero or negative values.

Jacob Keller reviewed the patch. He noted that people may disagree about whether a reasonable number of jobs should equal the number of CPUs, but said the text is the same as for `git fetch` and is an acceptable default, often what users expect from other software. He added a Reviewed-by trailer.
