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

[3/7] feat(submit): support passing --jobs #1355

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading