Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--jobs=0 no longer does any work #4302

Closed
1 task done
drewnoakes opened this issue Feb 20, 2023 · 4 comments
Closed
1 task done

--jobs=0 no longer does any work #4302

drewnoakes opened this issue Feb 20, 2023 · 4 comments
Assignees
Milestone

Comments

@drewnoakes
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

(Note that I did report this on the git mailing list here, but no response was received.)

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.39.2.windows.1
cpu: x86_64
built from commit: a82fa99b36ddfd643e61ed45e52abe314687df67
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.22621.1265]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
Editor Option: VIM
Custom Editor Path:
Default Branch Option: main
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Not that I know of.

Details

  • Which terminal/shell are you running Git from?

Git Bash

git fetch --jobs=0
  • What did you expect to occur after running these commands?

Fetches from my multiple remotes to occur concurrently.

  • What actually happened instead?

Nothing was fetched.

Yesterday, nothing was logged. Today I see an error message (no idea what changed):

BUG: run-command.c:1521: you must provide a non-zero number of processes!

Note also:

  • The git-config documentation says of zero jobs in "fetch.parallel" that "A value of 0 will give some reasonable default. If unset, it defaults to 1.".

  • This started happening after I updated my version of Git for Windows earlier today.

  • Excluding the --jobs argument or passing a non-zero value works as expected.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Doesn't seem related to a specific repo.

@rimrul
Copy link
Member

rimrul commented Feb 20, 2023

For completeness: This has also been reported on the mailing list.

run-command.c:1521

Ok, that's a starting point where to look.
And bingo. A blame on run-command.c:L1521 tells us it was last changed in 51243f9.

Looks like Ævar added the online_cpus() fallback in fetch.c for fetch.parallel, but missed --jobs=0. I'll try to write a fix in the next few days.

rimrul added a commit to rimrul/git that referenced this issue Feb 20, 2023
prior to 51243f9 (run-command API: don't fall back on online_cpus(),
2022-10-12) `git fetch --multiple --jobs=0` would coose some default amount
of jobs, similar to `git -c fetch.parallel=0 fetch --multiple`. While our
documentation only ever promised that `fetch.parallel` would fall back to a
"sensible default", it makes sense to do the same for `--jobs`. So fall back
to online_cpus() and not BUG() out.

This fixes git-for-windows#4302

Reported-by: Drew Noakes <drnoakes@microsoft.com>
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
rimrul added a commit to rimrul/git that referenced this issue Feb 20, 2023
prior to 51243f9 (run-command API: don't fall back on online_cpus(),
2022-10-12) `git fetch --multiple --jobs=0` would choose some default amount
of jobs, similar to `git -c fetch.parallel=0 fetch --multiple`. While our
documentation only ever promised that `fetch.parallel` would fall back to a
"sensible default", it makes sense to do the same for `--jobs`. So fall back
to online_cpus() and not BUG() out.

This fixes git-for-windows#4302

Reported-by: Drew Noakes <drnoakes@microsoft.com>
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
@dscho
Copy link
Member

dscho commented Feb 21, 2023

@rimrul since you seem to be almost there anyway, I added you as assignee, okay?

@rimrul
Copy link
Member

rimrul commented Feb 21, 2023

since you seem to be almost there anyway, I added you as assignee, okay?

yes. I've submitted the patch to the mailing list.

@rimrul
Copy link
Member

rimrul commented Feb 25, 2023

The fix has not made it in time for Git 2.40.0-rc0, but will be part of 2.40.0-rc1.

@dscho dscho added this to the Next release milestone Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants