Skip to content
Open
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
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* New `merge_point()` revset function which (similar to `fork_point`) finds the
point where multiple branches merge.

* New `builtin_workspace_list` and `builtin_workspace_list_with_root` template
aliases are available for `jj workspace list`.
* `jj workspace list` now shows workspace roots by default. The output can be
customized with `templates.workspace_list` or `-T`, and `WorkspaceRef.root()`
returns an optional `FsPath` value.
[#9713](https://github.com/jj-vcs/jj/pull/9713),
[#9826](https://github.com/jj-vcs/jj/pull/9826)

* `jj run` now processes revisions from oldest to newest by default. The start
order is guaranteed: each revision begins execution only after the previous
Expand Down
3 changes: 0 additions & 3 deletions cli/src/commands/workspace/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ pub struct WorkspaceListArgs {
/// The default template can be set by the `templates.workspace_list`
/// setting.
///
/// Use `-T builtin_workspace_list_with_root` to include workspace root
/// paths.
///
/// [`WorkspaceRef` type]:
/// https://docs.jj-vcs.dev/latest/templates/#workspaceref-type
///
Expand Down
9 changes: 0 additions & 9 deletions cli/src/config/templates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,6 @@ label(if(op.current_operation(), "current_operation"),
'''

builtin_workspace_list = '''
concat(
name,
": ",
format_commit_summary_with_refs(target, format_commit_ref_names(target.bookmarks())),
"\n",
)
'''

builtin_workspace_list_with_root = '''
concat(
name,
": ",
Expand Down
2 changes: 0 additions & 2 deletions cli/tests/cli-reference@.md.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3769,8 +3769,6 @@ List workspaces

The default template can be set by the `templates.workspace_list` setting.

Use `-T builtin_workspace_list_with_root` to include workspace root paths.

[`WorkspaceRef` type]: https://docs.jj-vcs.dev/latest/templates/#workspaceref-type

[`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
Expand Down
1 change: 0 additions & 1 deletion cli/tests/test_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,6 @@ fn test_template_alias() {
builtin_op_log_oneline
builtin_op_log_redacted
builtin_workspace_list
builtin_workspace_list_with_root
commit_summary_separator
default_commit_description
description_placeholder
Expand Down
1 change: 0 additions & 1 deletion cli/tests/test_evolog_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ fn test_evolog_with_no_template() {
- builtin_op_log_oneline
- builtin_op_log_redacted
- builtin_workspace_list
- builtin_workspace_list_with_root
- commit_summary_separator
- default_commit_description
- description_placeholder
Expand Down
1 change: 0 additions & 1 deletion cli/tests/test_log_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fn test_log_with_no_template() {
- builtin_op_log_oneline
- builtin_op_log_redacted
- builtin_workspace_list
- builtin_workspace_list_with_root
- commit_summary_separator
- default_commit_description
- description_placeholder
Expand Down
1 change: 0 additions & 1 deletion cli/tests/test_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ fn test_op_log_with_no_template() {
- builtin_op_log_oneline
- builtin_op_log_redacted
- builtin_workspace_list
- builtin_workspace_list_with_root
- commit_summary_separator
- default_commit_description
- description_placeholder
Expand Down
1 change: 0 additions & 1 deletion cli/tests/test_show_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ fn test_show_with_no_template() {
- builtin_op_log_oneline
- builtin_op_log_redacted
- builtin_workspace_list
- builtin_workspace_list_with_root
- commit_summary_separator
- default_commit_description
- description_placeholder
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/test_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn test_templater_parse_error() {
| ^-----^
|
= Keyword `builtin` doesn't exist
Hint: Did you mean `builtin_config_list`, `builtin_config_list_detailed`, `builtin_draft_commit_description`, `builtin_draft_commit_description_with_diff`, `builtin_evolog_compact`, `builtin_log_comfortable`, `builtin_log_compact`, `builtin_log_compact_full_description`, `builtin_log_detailed`, `builtin_log_node`, `builtin_log_node_ascii`, `builtin_log_oneline`, `builtin_log_redacted`, `builtin_op_log_comfortable`, `builtin_op_log_compact`, `builtin_op_log_node`, `builtin_op_log_node_ascii`, `builtin_op_log_oneline`, `builtin_op_log_redacted`, `builtin_workspace_list`, `builtin_workspace_list_with_root`?
Hint: Did you mean `builtin_config_list`, `builtin_config_list_detailed`, `builtin_draft_commit_description`, `builtin_draft_commit_description_with_diff`, `builtin_evolog_compact`, `builtin_log_comfortable`, `builtin_log_compact`, `builtin_log_compact_full_description`, `builtin_log_detailed`, `builtin_log_node`, `builtin_log_node_ascii`, `builtin_log_oneline`, `builtin_log_redacted`, `builtin_op_log_comfortable`, `builtin_op_log_compact`, `builtin_op_log_node`, `builtin_op_log_node_ascii`, `builtin_op_log_oneline`, `builtin_op_log_redacted`, `builtin_workspace_list`?
[EOF]
[exit status: 1]
");
Expand Down
117 changes: 50 additions & 67 deletions cli/tests/test_workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ fn test_workspaces_add_second_and_third_workspace() {
main_dir.run_jj(["commit", "-m", "initial"]).success();

let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz 504e3d8c (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -94,9 +94,9 @@ fn test_workspaces_add_second_and_third_workspace() {

// Both workspaces show up when we list them
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
second: rzvqmyuk bcc858e1 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz 504e3d8c (empty) (no description set)
second: ../secondary rzvqmyuk bcc858e1 (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -262,7 +262,7 @@ fn test_workspaces_add_second_workspace_on_merge() {

let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: zsuskuln 46ed31b6 (empty) merge
default: . zsuskuln 46ed31b6 (empty) merge
[EOF]
");

Expand Down Expand Up @@ -414,7 +414,7 @@ fn test_workspaces_add_workspace_at_revision() {

let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: kkmpptxz 5ac9178d (empty) (no description set)
default: . kkmpptxz 5ac9178d (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -537,8 +537,8 @@ fn test_workspaces_add_workspace_from_subdir() {
main_dir.run_jj(["commit", "-m", "initial"]).success();

let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 0ba0ff35 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz 0ba0ff35 (empty) (no description set)
[EOF]
");

Expand All @@ -555,9 +555,9 @@ fn test_workspaces_add_workspace_from_subdir() {

// Both workspaces show up when we list them
let output = secondary_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 0ba0ff35 (empty) (no description set)
secondary: rzvqmyuk dea1be10 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: ../main rlvkpnrz 0ba0ff35 (empty) (no description set)
secondary: . rzvqmyuk dea1be10 (empty) (no description set)
[EOF]
");
}
Expand Down Expand Up @@ -586,8 +586,8 @@ fn test_workspaces_add_workspace_in_current_workspace() {
// Workspace created despite warning
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
secondary: pmmvwywv 058f604d (empty) (no description set)
default: . rlvkpnrz 504e3d8c (empty) (no description set)
secondary: secondary pmmvwywv 058f604d (empty) (no description set)
[EOF]
");

Expand All @@ -605,9 +605,9 @@ fn test_workspaces_add_workspace_in_current_workspace() {
// Both workspaces created
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
secondary: pmmvwywv 058f604d (empty) (no description set)
third: zxsnswpr 1c1effec (empty) (no description set)
default: . rlvkpnrz 504e3d8c (empty) (no description set)
secondary: secondary pmmvwywv 058f604d (empty) (no description set)
third: third zxsnswpr 1c1effec (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -639,9 +639,9 @@ fn test_workspace_add_override_path_in_store() {

// Both workspaces show up when we list them
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
second: pmmvwywv 058f604d (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz 504e3d8c (empty) (no description set)
second: ../secondary pmmvwywv 058f604d (empty) (no description set)
[EOF]
");

Expand All @@ -655,8 +655,8 @@ fn test_workspace_add_override_path_in_store() {

// Only default workspace show up when we list them
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz 504e3d8c (empty) (no description set)
[EOF]
");

Expand All @@ -673,9 +673,9 @@ fn test_workspace_add_override_path_in_store() {

// Both workspaces show up when we list them
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz 504e3d8c (empty) (no description set)
second: spxsnpux 96ef6c50 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz 504e3d8c (empty) (no description set)
second: ../tertiary spxsnpux 96ef6c50 (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -1471,8 +1471,8 @@ fn test_workspaces_forget() {

// When listing workspaces, only the secondary workspace shows up
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
secondary: pmmvwywv 31da1455 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
secondary: ../secondary pmmvwywv 31da1455 (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -1586,10 +1586,10 @@ fn test_workspaces_forget_multi_transaction() {

// there should be three workspaces
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz f6bf8819 (empty) (no description set)
second: pmmvwywv 31da1455 (empty) (no description set)
third: rzvqmyuk bf5b5b4d (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz f6bf8819 (empty) (no description set)
second: ../second pmmvwywv 31da1455 (empty) (no description set)
third: ../third rzvqmyuk bf5b5b4d (empty) (no description set)
[EOF]
");

Expand All @@ -1598,8 +1598,8 @@ fn test_workspaces_forget_multi_transaction() {
.run_jj(["workspace", "forget", "second", "third", "fourth"])
.success();
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz f6bf8819 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz f6bf8819 (empty) (no description set)
[EOF]
");

Expand All @@ -1617,8 +1617,8 @@ fn test_workspaces_forget_multi_transaction() {

// finally, there should be three workspaces at the end
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: rlvkpnrz f6bf8819 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . rlvkpnrz f6bf8819 (empty) (no description set)
second: pmmvwywv 31da1455 (empty) (no description set)
third: rzvqmyuk bf5b5b4d (empty) (no description set)
[EOF]
Expand All @@ -1643,11 +1643,11 @@ fn test_workspaces_forget_abandon_commits() {

// there should be four workspaces, three of which are at the same empty commit
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: qpvuntsm 006bd113 (no description set)
fourth: uuqppmxq 94f41578 (empty) (no description set)
second: uuqppmxq 94f41578 (empty) (no description set)
third: uuqppmxq 94f41578 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . qpvuntsm 006bd113 (no description set)
fourth: ../fourth uuqppmxq 94f41578 (empty) (no description set)
second: ../second uuqppmxq 94f41578 (empty) (no description set)
third: ../third uuqppmxq 94f41578 (empty) (no description set)
[EOF]
");
insta::assert_snapshot!(get_log_output(&main_dir), @"
Expand Down Expand Up @@ -1772,18 +1772,6 @@ fn test_list_workspaces_template_root() {
second: ../secondary
[EOF]
");

let output = main_dir.run_jj([
"workspace",
"list",
"-T",
"builtin_workspace_list_with_root",
]);
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . qpvuntsm e8849ae1 (empty) (no description set)
second: ../secondary uuqppmxq 94f41578 (empty) (no description set)
[EOF]
");
}

#[test]
Expand Down Expand Up @@ -1813,12 +1801,7 @@ fn test_list_workspaces_template_root_unavailable() {
[EOF]
");

let output = main_dir.run_jj([
"workspace",
"list",
"-T",
"builtin_workspace_list_with_root",
]);
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: . qpvuntsm e8849ae1 (empty) (no description set)
second: uuqppmxq 94f41578 (empty) (no description set)
Expand Down Expand Up @@ -1893,9 +1876,9 @@ fn test_workspaces_relative_path() -> TestResult {
");

let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: qpvuntsm e8849ae1 (empty) (no description set)
secondary: uuqppmxq 94f41578 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . qpvuntsm e8849ae1 (empty) (no description set)
secondary: ../secondary uuqppmxq 94f41578 (empty) (no description set)
[EOF]
");

Expand Down Expand Up @@ -2038,19 +2021,19 @@ fn test_workspaces_rename_workspace() {

// Both workspaces show up when we list them
let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: qpvuntsm e8849ae1 (empty) (no description set)
second: uuqppmxq 94f41578 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . qpvuntsm e8849ae1 (empty) (no description set)
second: ../secondary uuqppmxq 94f41578 (empty) (no description set)
[EOF]
");

let output = secondary_dir.run_jj(["workspace", "rename", "third"]);
insta::assert_snapshot!(output, @"");

let output = main_dir.run_jj(["workspace", "list"]);
insta::assert_snapshot!(output, @"
default: qpvuntsm e8849ae1 (empty) (no description set)
third: uuqppmxq 94f41578 (empty) (no description set)
insta::assert_snapshot!(output.normalize_backslash(), @"
default: . qpvuntsm e8849ae1 (empty) (no description set)
third: ../secondary uuqppmxq 94f41578 (empty) (no description set)
[EOF]
");

Expand Down
18 changes: 0 additions & 18 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,24 +627,6 @@ you can add this to your config:
config_list = "builtin_config_list_detailed"
```

If you want `jj workspace list` to show each workspace root, you can use the
shipped root-path template:

```sh
jj workspace list -T builtin_workspace_list_with_root
```

Workspaces whose roots are not recorded or cannot be resolved are shown without
the root path. Workspace roots are not recorded for workspaces created before jj
0.38.0.

Or make it your default:

```toml
[templates]
workspace_list = "builtin_workspace_list_with_root"
```

## Log

### Default revisions
Expand Down
3 changes: 1 addition & 2 deletions docs/working-copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ while you continue developing in another, for example. If needed,
`jj workspace root --name <workspace>` prints the root path of the specified
workspace (defaults to the current one).

Use `jj workspace list -T builtin_workspace_list_with_root` to show every
workspace together with its available root path.
`jj workspace list` shows every workspace together with its available root path.

When you're done using a workspace, use `jj workspace forget` to make the repo
forget about it. The files can be deleted from disk separately (either before or
Expand Down