ok/jj
1
0
Fork 0
forked from mirrors/jj

Include @ in the default revset

Yields a less confusing behavior of `jj log` after pushing a commit.
This commit is contained in:
Benjamin Saunders 2022-10-18 22:21:25 -07:00
parent d188240939
commit 646fc338ab
5 changed files with 18 additions and 6 deletions

View file

@ -82,7 +82,7 @@ impl UserSettings {
pub fn default_revset(&self) -> String {
self.config
.get_string("ui.default-revset")
.unwrap_or_else(|_| "remote_branches().. | (remote_branches()..)-".to_string())
.unwrap_or_else(|_| "@ | remote_branches().. | (remote_branches()..)-".to_string())
}
pub fn signature(&self) -> Signature {

View file

@ -259,7 +259,7 @@ struct StatusArgs {}
#[derive(clap::Args, Clone, Debug)]
struct LogArgs {
/// Which revisions to show. Defaults to the `ui.default-revset` setting,
/// or "remote_branches().. | (remote_branches()..)-" if it is not set.
/// or "@ | remote_branches().. | (remote_branches()..)-" if it is not set.
#[arg(long, short)]
revisions: Option<String>,
/// Show commits modifying the given paths

View file

@ -101,7 +101,7 @@ fn test_alias_global_args_before_and_after() {
let repo_path = test_env.env_root().join("repo");
test_env.add_config(
br#"[alias]
l = ["log", "-T", "commit_id"]
l = ["log", "-T", "commit_id", "-r", "all()"]
"#,
);
// Test the setup
@ -140,7 +140,7 @@ fn test_alias_global_args_in_definition() {
let repo_path = test_env.env_root().join("repo");
test_env.add_config(
br#"[alias]
l = ["log", "-T", "commit_id", "--at-op", "@-"]
l = ["log", "-T", "commit_id", "--at-op", "@-", "-r", "all()"]
"#,
);

View file

@ -90,7 +90,10 @@ fn test_op_log() {
}
fn get_log_output(test_env: &TestEnvironment, repo_path: &Path, op_id: &str) -> String {
test_env.jj_cmd_success(repo_path, &["log", "-T", "commit_id", "--at-op", op_id])
test_env.jj_cmd_success(
repo_path,
&["log", "-T", "commit_id", "--at-op", op_id, "-r", "all()"],
)
}
fn redact_op_log(stdout: &str) -> String {

View file

@ -198,5 +198,14 @@ fn test_workspaces_forget() {
}
fn get_log_output(test_env: &TestEnvironment, cwd: &Path) -> String {
test_env.jj_cmd_success(cwd, &["log", "-T", r#"commit_id " " working_copies"#])
test_env.jj_cmd_success(
cwd,
&[
"log",
"-T",
r#"commit_id " " working_copies"#,
"-r",
"all()",
],
)
}