Skip to content

Commit

Permalink
feat(submit): support passing --jobs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arxanas committed Jul 2, 2024
1 parent 878e6f7 commit 235f224
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions git-branchless-opts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ pub struct SubmitArgs {
#[clap(short = 'm', long = "message")]
pub message: Option<String>,

/// If the forge supports it, how many jobs to execute in parallel. The
/// value `0` indicates to use all CPUs.
#[clap(short = 'j', long = "jobs")]
pub num_jobs: Option<usize>,

/// If the forge supports it and uses a tool that needs access to the
/// working copy, what kind of execution strategy to use.
#[clap(short = 's', long = "strategy")]
Expand Down
5 changes: 4 additions & 1 deletion git-branchless-submit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ pub fn command_main(ctx: CommandContext, args: SubmitArgs) -> EyreExitOr<()> {
create,
draft,
message,
num_jobs,
execution_strategy,
dry_run,
} = args;
Expand All @@ -204,6 +205,7 @@ pub fn command_main(ctx: CommandContext, args: SubmitArgs) -> EyreExitOr<()> {
create,
draft,
message,
num_jobs,
execution_strategy,
dry_run,
)
Expand All @@ -218,6 +220,7 @@ fn submit(
create: bool,
draft: bool,
message: Option<String>,
num_jobs: Option<usize>,
execution_strategy: Option<TestExecutionStrategy>,
dry_run: bool,
) -> EyreExitOr<()> {
Expand Down Expand Up @@ -253,7 +256,7 @@ fn submit(
bisect: false,
no_cache: true,
interactive: false,
jobs: None,
jobs: num_jobs,
verbosity: Verbosity::None,
apply_fixes: false,
};
Expand Down

0 comments on commit 235f224

Please sign in to comment.