diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 71af456307e..38542ee37f7 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -1012,7 +1012,12 @@ impl WorkspaceCommandHelper { let immutable = revset_util::parse_immutable_expression(&self.revset_parse_context())?; let mut expression = self.attach_revset_evaluator(immutable)?; expression.intersect_with(&to_rewrite_revset); - if let Some(commit_id) = expression.evaluate_to_commit_ids()?.next() { + + let mut commit_id_iter = expression.evaluate_to_commit_ids().map_err(|e| { + config_error_with_message("Invalid `revset-aliases.immutable_heads()`", e) + })?; + + if let Some(commit_id) = commit_id_iter.next() { let error = if &commit_id == self.repo().store().root_commit_id() { user_error(format!( "The root commit {} is immutable", diff --git a/docs/contributing.md b/docs/contributing.md index c4c75c64480..881185385a3 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -114,7 +114,7 @@ You will probably also want to make the `gh-pages` branch immutable (and thereby hidden from the default `jj log` output) by running the following in your repo: ```shell -jj config set --repo "revset-aliases.immutable_heads()" "main@origin | gh-pages@origin" +jj config set --repo "revset-aliases.immutable_heads()" 'remote_branches(exact:"main") | remote_branches(exact:"gh-pages")' ``` ### Summary