Skip to content

Commit

Permalink
Remove the branch command
Browse files Browse the repository at this point in the history
Remove the branch command because the request-review-command now
provides all the functionality that the branch command provided and
more. Also we have plans to rename the request-review-command to branch
after this code is removed.

[changelog]
removed: the branch command

<!-- ps-id: 714b27d5-6fd7-4e11-8ba1-e9e2e89bde3d -->
  • Loading branch information
drewdeponte committed Oct 20, 2023
1 parent 24d7d20 commit abb9177
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 221 deletions.
26 changes: 0 additions & 26 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@ pub struct BatchRequestReview {
pub patch_index: Vec<usize>,
}

#[derive(Debug, Args)]
pub struct BranchCmdOpts {
/// index of patch to cherry-pick to branch or starting index of patch
/// series to cherry-pick to the branch
pub start_patch_index: usize,
/// ending patch index of the patch series to cherry-pick to the branch
pub end_patch_index: Option<usize>,
/// Use the provided branch name instead of generating one
#[arg(short = 'n')]
pub branch_name: Option<String>,
/// Push branch of the same name to the remote
#[arg(short = 'p')]
pub push_to_remote: bool,
}

#[derive(Debug, Args)]
pub struct RequestReviewBranchCmdOpts {
pub patch_index_or_range: String,
Expand Down Expand Up @@ -88,17 +73,6 @@ pub struct BackupStackCmdOpts {

#[derive(Debug, Subcommand)]
pub enum Command {
/// Your bridge back to the world of normal git and git concepts. The branch command is a
/// utility to help you create a normal git branch from a patch or series of patches that is
/// based on the patch stack base (e.g. origin/main).
///
/// Because this is a bridge back to the normal git concepts like branches and commits it
/// only supports the verify isolation hook.
///
/// It also has support for automatically pushing the branch to the remote. This is useful when
/// you are stuck working with a team that doesn't do the Patch Stack workflow but you still
/// want to do it locally.
Branch(BranchCmdOpts),
/// Create a request review branch on the patch stack base, cherry-pick
/// the specified patch onto it, & record association between patch &
/// branch
Expand Down
40 changes: 0 additions & 40 deletions src/commands/branch.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

pub mod backup_stack;
pub mod batch_request_review;
pub mod branch;
pub mod checkout;
pub mod fetch;
pub mod integrate;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mod ps;
pub use ps::private::config::{get_config, GetConfigError, PsConfig};
pub use ps::public::backup_stack::backup_stack;
pub use ps::public::batch_request_review::{batch_request_review, BatchRequestReviewError};
pub use ps::public::branch::{branch, BranchError};
pub use ps::public::checkout::checkout;
pub use ps::public::fetch::fetch;
pub use ps::public::integrate;
Expand Down
7 changes: 0 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ fn main() {
let cli = cli::Cli::parse();

match cli.command {
cli::Command::Branch(opts) => commands::branch::branch(
opts.start_patch_index,
opts.end_patch_index,
opts.branch_name,
opts.push_to_remote,
cli.color,
),
cli::Command::RequestReviewBranch(opts) => {
commands::request_review_branch::request_review_branch(
opts.patch_index_or_range,
Expand Down
13 changes: 0 additions & 13 deletions src/ps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ pub fn generate_rr_branch_name(summary: &str) -> String {
format!("ps/rr/{}", slug)
}

pub fn generate_branch_branch_name(summary: &str) -> String {
let slug = slugify(summary);
format!("ps/branch/{}", slug)
}

/// Cherry pick either an individual commit identified by the `root_oid` Oid and None for
/// `leaf_oid`, or a range of commits identified by the `root_oid` and `leaf_oid` both having Oids.
///
Expand Down Expand Up @@ -524,12 +519,4 @@ mod tests {
"ps/rr/hello___goodbye"
);
}

#[test]
fn test_generate_branch_branch_name() {
assert_eq!(
super::generate_branch_branch_name("Hello & Goodbye"),
"ps/branch/hello___goodbye"
);
}
}
132 changes: 0 additions & 132 deletions src/ps/public/branch.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/ps/public/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pub mod backup_stack;
pub mod batch_request_review;
pub mod branch;
pub mod checkout;
pub mod fetch;
pub mod integrate;
Expand Down

0 comments on commit abb9177

Please sign in to comment.