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

cli: unblock "branch list --all-remotes" with name patterns #3423

Merged
merged 1 commit into from
Apr 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `jj duplicate` and `jj abandon` can now take more than a single `-r` argument,
for consistency with other commands.

* `jj branch list` now allows combining `-r` and `-a` options.
* `jj branch list` now allows combining `-r REVISIONS`/`NAMES` and `-a` options.

* `--all` is now named `--all-remotes` for `jj branch list`

Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub struct BranchDeleteArgs {
pub struct BranchListArgs {
/// Show all tracking and non-tracking remote branches including the ones
/// whose targets are synchronized with the local branches.
#[arg(long, short, alias = "all", conflicts_with_all = ["names", "tracked"])]
#[arg(long, short, alias = "all")]
all_remotes: bool,

/// Show remote tracked branches only. Omits local Git-tracking branches by
Expand Down
5 changes: 5 additions & 0 deletions cli/tests/test_branch_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,11 @@ fn test_branch_list_filtered() {

// Select branches by name, combined with --all-remotes
test_env.jj_cmd_ok(&local_path, &["git", "export"]);
insta::assert_snapshot!(query(&["--all-remotes", "remote-rewrite"]), @r###"
remote-rewrite: xyxluytn e31634b6 (empty) rewritten
@git: xyxluytn e31634b6 (empty) rewritten
@origin (ahead by 1 commits, behind by 1 commits): xyxluytn hidden 3e9a5af6 (empty) remote-rewrite
"###);
insta::assert_snapshot!(query(&["--all-remotes", "-rbranches(remote-rewrite)"]), @r###"
remote-rewrite: xyxluytn e31634b6 (empty) rewritten
@git: xyxluytn e31634b6 (empty) rewritten
Expand Down