From: Jeff King Date: Mon, 06 Aug 2018 13:42:38 GMT Subject: Re: [PATCH] add a script to diff rendered documentation Message-ID: <20180806134237.GB31282@sigill.intra.peff.net> In-Reply-To: <20180806133954.GA31282@sigill.intra.peff.net> On Mon, Aug 06, 2018 at 09:39:55AM -0400, Jeff King wrote: > 3. Default to number of CPUs, which is what a lot of other threading > in Git does. Unfortunately getting that from the shell is > non-trivial. I'm OK with $(grep -c ^processor /proc/cpuinfo), but > people on non-Linux platforms would have to fill in their own > implementation. Is this too horrible to contemplate? diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 0f09bbbf65..fa8caeec0c 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -635,6 +635,11 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) continue; } + if (!strcmp(arg, "--online-cpus")) { + printf("%d", online_cpus()); + continue; + } + /* The rest of the options require a git repository. */ if (!did_repo_setup) { prefix = setup_git_directory(); -Peff