cli: enable fileset by default

I've tested it for months and found no problems.
This commit is contained in:
Yuya Nishihara 2024-07-23 19:16:22 +09:00
parent bf7f3d7c60
commit 8fec7500c3
6 changed files with 24 additions and 25 deletions

View file

@ -23,6 +23,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* Updated defaults for graph node symbol templates `templates.log_node` and
`templates.op_log_node`.
* [The "fileset" language](docs/filesets.md) is now enabled by default. It can
still be disable by setting `ui.allow-filesets=false`.
### Deprecations
### New features

View file

@ -9,7 +9,8 @@ unamend = ["unsquash"]
tree-level-conflicts = true
[ui]
allow-filesets = false
# TODO: delete ui.allow-filesets in jj 0.26+
allow-filesets = true
always-allow-large-revsets = false
diff-instructions = true
paginate = "auto"

View file

@ -198,15 +198,7 @@ fn test_diff_basic() {
"###);
// Filter by glob pattern
let stdout = test_env.jj_cmd_success(
&repo_path,
&[
"diff",
"--config-toml=ui.allow-filesets=true",
"-s",
"glob:file[12]",
],
);
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "glob:file[12]"]);
insta::assert_snapshot!(stdout, @r###"
D file1
M file2

View file

@ -233,8 +233,6 @@ fn test_bad_path() {
let subdir = repo_path.join("dir");
std::fs::create_dir_all(&subdir).unwrap();
test_env.add_config("ui.allow-filesets = true");
// cwd == workspace_root
let stderr = test_env.jj_cmd_failure(&repo_path, &["file", "show", "../out"]);
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
@ -450,8 +448,16 @@ fn test_color_ui_messages() {
// error source
let stderr = test_env.jj_cmd_failure(&repo_path, &["log", ".."]);
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
Error: Path ".." is not in the repo "."
Caused by: Invalid component ".." in repo-relative path "../"
Error: Failed to parse fileset: Invalid file pattern
Caused by:
1:  --> 1:1
 |
1 | ..
 | ^^
 |
 = Invalid file pattern
2: Path ".." is not in the repo "."
3: Invalid component ".." in repo-relative path "../"
"###);
// warning

View file

@ -825,18 +825,22 @@ fn test_log_filtered_by_path() {
A file2
"###);
// Fileset/pattern syntax is disabled by default.
// Fileset/pattern syntax can be disabled.
let stderr = test_env.jj_cmd_failure(
test_env.env_root(),
&["log", "-R", repo_path.to_str().unwrap(), "all()"],
&[
"log",
"--config-toml=ui.allow-filesets=false",
"-R",
repo_path.to_str().unwrap(),
"all()",
],
);
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
Error: Path "all()" is not in the repo "repo"
Caused by: Invalid component ".." in repo-relative path "../all()"
"###);
test_env.add_config("ui.allow-filesets = true");
// empty revisions are filtered out by "all()" fileset.
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-Tdescription", "-s", "all()"]);
insta::assert_snapshot!(stdout, @r###"

View file

@ -5,13 +5,6 @@ Expressions in this language are called "filesets" (the idea comes from
[Mercurial](https://repo.mercurial-scm.org/hg/help/filesets)). The language
consists of file patterns, operators, and functions.
**Filesets support is still experimental.** It can be enabled by
`ui.allow-filesets`.
```toml
ui.allow-filesets = true
```
Many `jj` commands accept fileset expressions as positional arguments. File
names passed to these commands [must be quoted][string-literals] if they contain
whitespace or meta characters. However, as a special case, quotes can be omitted