{"record":{"id":"c530f6a79fe5ecff","repo":"jdx/mise","slug":"a-repository-preview-directory-requires-a-dry-run","errorCode":null,"errorMessage":"a repository preview directory requires a dry run","messagePattern":"a repository preview directory requires a dry run","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/ssh.rs","lineNumber":71,"sourceCode":"    #[usage(long, hide = true)]\n    repository_dry_run: bool,\n    #[usage(long, hide = true)]\n    repository_preview_directory: Option<PathBuf>,\n    #[usage(long, hide = true)]\n    global_config_directory: bool,\n    /// Command to execute after --; omit for an interactive shell\n    #[usage(trailing_var_arg = true, allow_hyphen_values = true)]\n    command: Vec<String>,\n}\n\nimpl Ssh {\n    pub(crate) async fn run(self) -> Result<()> {\n        self.run_inner().await\n    }\n\n    async fn run_inner(self) -> Result<()> {\n        if self.repository_preview_directory.is_some() && !self.repository_dry_run {\n            bail!(\"a repository preview directory requires a dry run\");\n        }\n        if self.global_config_directory {\n            println!(\n                \"{}\",\n                crate::system::remote_repository::global_directory().display()\n            );\n            return Ok(());\n        }\n        if let Some(bundle) = self.repository_bundle {\n            let origin = self\n                .repository_origin\n                .ok_or_else(|| eyre::eyre!(\"missing repository origin\"))?;\n            let revision = self\n                .repository_revision\n                .ok_or_else(|| eyre::eyre!(\"missing repository revision\"))?;\n            // a history-managed setup repository is set up from, never\n            // checked out into the configuration directory\n            if let Some(branch) =","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/ssh.rs#L53-L89","documentation":"`mise ssh` supports a --repository-preview-directory option that only makes sense in combination with --repository-dry-run: a preview directory stages repository content without applying it, which presupposes the dry-run mode. If a preview directory is supplied without dry-run, mise rejects the combination up front rather than applying changes unexpectedly.","triggerScenarios":"Running `mise ssh --repository-preview-directory <dir>` without also passing --repository-dry-run.","commonSituations":"Testing repository setup changes with a preview directory but forgetting the dry-run flag; scripting the command and dropping the dry-run flag; misunderstanding the two flags as independent.","solutions":["Add --repository-dry-run to the command.","If you actually want to apply changes, remove --repository-preview-directory instead.","Review `mise ssh --help` for the intended dry-run + preview workflow."],"exampleFix":"// before\nmise ssh --repository-preview-directory ./preview\n// error: a repository preview directory requires a dry run\n\n// after\nmise ssh --repository-dry-run --repository-preview-directory ./preview","handlingStrategy":"validation","validationCode":"if [ -n \"$preview_dir\" ] && [ -z \"$dry_run\" ]; then echo 'add --repository-dry-run with --repository-preview-directory' >&2; fi","typeGuard":null,"tryCatchPattern":"mise ssh --repository-dry-run --repository-preview-directory \"$dir\" || echo 'preview failed; inspect flags'","preventionTips":["Treat --repository-preview-directory and --repository-dry-run as a pair","Check `mise ssh --help` before scripting new flag combinations","Test dry-run + preview before any real repository setup"],"tags":["cli","ssh","flags","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}