Skip to content

Commit 235f224

Browse files
committed
feat(submit): support passing --jobs
This is currently used only by the Phabricator forge, which uses the `git test` infrastructure to run `arc` on several commits at once. I don't know how well it works when an error occurs.
1 parent 878e6f7 commit 235f224

File tree

2 files changed

+9
-1
lines changed
  • git-branchless-opts/src
  • git-branchless-submit/src

2 files changed

+9
-1
lines changed

git-branchless-opts/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ pub struct SubmitArgs {
408408
#[clap(short = 'm', long = "message")]
409409
pub message: Option<String>,
410410

411+
/// If the forge supports it, how many jobs to execute in parallel. The
412+
/// value `0` indicates to use all CPUs.
413+
#[clap(short = 'j', long = "jobs")]
414+
pub num_jobs: Option<usize>,
415+
411416
/// If the forge supports it and uses a tool that needs access to the
412417
/// working copy, what kind of execution strategy to use.
413418
#[clap(short = 's', long = "strategy")]

git-branchless-submit/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ pub fn command_main(ctx: CommandContext, args: SubmitArgs) -> EyreExitOr<()> {
192192
create,
193193
draft,
194194
message,
195+
num_jobs,
195196
execution_strategy,
196197
dry_run,
197198
} = args;
@@ -204,6 +205,7 @@ pub fn command_main(ctx: CommandContext, args: SubmitArgs) -> EyreExitOr<()> {
204205
create,
205206
draft,
206207
message,
208+
num_jobs,
207209
execution_strategy,
208210
dry_run,
209211
)
@@ -218,6 +220,7 @@ fn submit(
218220
create: bool,
219221
draft: bool,
220222
message: Option<String>,
223+
num_jobs: Option<usize>,
221224
execution_strategy: Option<TestExecutionStrategy>,
222225
dry_run: bool,
223226
) -> EyreExitOr<()> {
@@ -253,7 +256,7 @@ fn submit(
253256
bisect: false,
254257
no_cache: true,
255258
interactive: false,
256-
jobs: None,
259+
jobs: num_jobs,
257260
verbosity: Verbosity::None,
258261
apply_fixes: false,
259262
};

0 commit comments

Comments
 (0)