From 0e8fcc743b343c620a6723f5ad517ab98f140401 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 10 Oct 2025 17:25:49 +0100 Subject: feat(send): add `force-pr` or `force-patch` flags so users can choose when there commits are too big or small instead of relying on the 60kb rule --- src/bin/ngit/sub_commands/send.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs index ba64f64..0e4a572 100644 --- a/src/bin/ngit/sub_commands/send.rs +++ b/src/bin/ngit/sub_commands/send.rs @@ -43,6 +43,12 @@ pub struct SubCommandArgs { #[clap(short, long)] /// optional cover letter description pub(crate) description: Option, + /// publish as Pull Request even if each commit is < 60kb + #[arg(long, action)] + pub(crate) force_pr: bool, + /// publish as Patches even if they may be > 60kb + #[arg(long, action)] + pub(crate) force_patch: bool, } #[allow(clippy::too_many_lines)] @@ -116,7 +122,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re &main_tip, )?; - let as_pr = { + let should_be_pr = { if let Some(root_proposal) = &root_proposal { proposal_tip_is_pr_or_pr_update(git_repo_path, &repo_ref, &root_proposal.id).await? } else { @@ -124,6 +130,14 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re } } || git_repo.are_commits_too_big_for_patches(&commits); + let as_pr = if args.force_patch { + false + } else if args.force_pr { + true + } else { + should_be_pr + }; + let title = if as_pr { match &args.title { Some(t) => Some(t.clone()), -- cgit v1.2.3