Skip to content

main.sh: default -j on macOS to number of logical processors - #29

Merged
igagis merged 2 commits into
mainfrom
macos-default-jobs-logical-cpu
Dec 2, 2026
Merged

igagis merged 2 commits into
mainfrom
macos-default-jobs-logical-cpu

Conversation

@igagis-bot

Copy link
Copy Markdown
Contributor

Summary

  • On macOS (uname -s == Darwin), the default -j/--jobs is now the number of logical processors via sysctl -n hw.logicalcpu (the macOS twin of nproc(1)), falling back to 4 if sysctl is unavailable.
  • Non-macOS behavior is unchanged: nproc where available, else 4.
  • Help text updated to say the default is the number of logical processors.

Test plan

  • bash -n git/main.sh
  • Verified default-selection logic with stubbed uname/sysctl/nproc (Darwin→sysctl 10 wins over nproc, Linux→nproc, fallbacks→4)
  • Test on an actual macOS machine (./git/main.sh --help and a dry run)

@igagis-bot
igagis-bot requested a review from igagis December 2, 2026 19:48
@igagis
igagis merged commit 0e450af into main Dec 2, 2026
0 of 12 checks passed
@igagis
igagis deleted the macos-default-jobs-logical-cpu branch December 2, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants