mirror of
https://github.com/jj-vcs/jj.git
synced 2025-12-23 06:01:01 +00:00
Anytime an external tool is referenced in the config, the command can be
provided as a string or as a token array. In the latter case, the array
must not be empty; at least the command name must be provided.
The schema didn't previously object to an empty array, though; this has
now been rectified. I've added more sample configs to cover this case.
Those same configs can also be used to illustrate that this is indeed
jj's current behavior:
$ jj --config-file cli/tests/sample-configs/invalid/ui.pager_empty_array.toml show
Config error: Invalid type or value for ui.pager
Caused by: data did not match any variant of untagged enum CommandNameAndArgs
$ jj --config-file cli/tests/sample-configs/invalid/ui.pager.command_empty_array.toml show
Config error: Invalid type or value for ui.pager
Caused by: data did not match any variant of untagged enum CommandNameAndArgs
$ jj --config-file cli/tests/sample-configs/invalid/ui.editor_empty_array.toml config edit --user
Config error: Invalid type or value for ui.editor
Caused by: data did not match any variant of untagged enum CommandNameAndArgs
$ jj --config-file cli/tests/sample-configs/invalid/ui.diff-editor_empty_array.toml split
Error: Failed to load tool configuration
Caused by:
1: Invalid type or value for ui.diff-editor
2: data did not match any variant of untagged enum CommandNameAndArgs
$ jj --config-file cli/tests/sample-configs/invalid/ui.merge-editor_empty_array.toml resolve
Error: Failed to load tool configuration
Caused by:
1: Invalid type or value for ui.merge-editor
2: data did not match any variant of untagged enum CommandNameAndArgs
$ jj --config-file cli/tests/sample-configs/invalid/ui.diff.tool_empty_array.toml diff
Config error: Invalid type or value for ui.diff.tool
Caused by: data did not match any variant of untagged enum CommandNameAndArgs
$ jj --config-file cli/tests/sample-configs/invalid/fix.tools.command_empty_array.toml fix
Config error: Invalid type or value for fix.tools.black
Caused by: data did not match any variant of untagged enum CommandNameAndArgs
in `command`
As a notable exception, `ui.default-command` *is* allowed to be an empty
array. In that case, `jj` will print a usage message. This is also
covered by a valid sample config.
|
||
|---|---|---|
| .. | ||
| common | ||
| sample-configs | ||
| cli-reference@.md.snap | ||
| datatest_runner.rs | ||
| runner.rs | ||
| test_abandon_command.rs | ||
| test_absorb_command.rs | ||
| test_acls.rs | ||
| test_advance_bookmarks.rs | ||
| test_alias.rs | ||
| test_backout_command.rs | ||
| test_bookmark_command.rs | ||
| test_builtin_aliases.rs | ||
| test_commit_command.rs | ||
| test_commit_template.rs | ||
| test_completion.rs | ||
| test_concurrent_operations.rs | ||
| test_config_command.rs | ||
| test_config_schema.rs | ||
| test_copy_detection.rs | ||
| test_debug_command.rs | ||
| test_debug_init_simple_command.rs | ||
| test_describe_command.rs | ||
| test_diff_command.rs | ||
| test_diffedit_command.rs | ||
| test_duplicate_command.rs | ||
| test_edit_command.rs | ||
| test_evolog_command.rs | ||
| test_file_annotate_command.rs | ||
| test_file_chmod_command.rs | ||
| test_file_show_command.rs | ||
| test_file_track_untrack_commands.rs | ||
| test_fix_command.rs | ||
| test_generate_md_cli_help.rs | ||
| test_git_clone.rs | ||
| test_git_colocated.rs | ||
| test_git_fetch.rs | ||
| test_git_import_export.rs | ||
| test_git_init.rs | ||
| test_git_private_commits.rs | ||
| test_git_push.rs | ||
| test_git_remotes.rs | ||
| test_git_root.rs | ||
| test_gitignores.rs | ||
| test_global_opts.rs | ||
| test_help_command.rs | ||
| test_immutable_commits.rs | ||
| test_interdiff_command.rs | ||
| test_log_command.rs | ||
| test_new_command.rs | ||
| test_next_prev_commands.rs | ||
| test_operations.rs | ||
| test_parallelize_command.rs | ||
| test_rebase_command.rs | ||
| test_repo_change_report.rs | ||
| test_resolve_command.rs | ||
| test_restore_command.rs | ||
| test_revert_command.rs | ||
| test_revset_output.rs | ||
| test_root.rs | ||
| test_shell_completion.rs | ||
| test_show_command.rs | ||
| test_sign_unsign_commands.rs | ||
| test_simplify_parents_command.rs | ||
| test_sparse_command.rs | ||
| test_split_command.rs | ||
| test_squash_command.rs | ||
| test_status_command.rs | ||
| test_tag_command.rs | ||
| test_templater.rs | ||
| test_undo.rs | ||
| test_util_command.rs | ||
| test_working_copy.rs | ||
| test_workspaces.rs | ||