{"record":{"id":"3195d67a86055709","repo":"jdx/mise","slug":"select-one-operation-by-its-identifier-before-acce","errorCode":null,"errorMessage":"select one operation by its identifier before accepting current files","messagePattern":"select one operation by its identifier before accepting current files","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/recover.rs","lineNumber":79,"sourceCode":"        }\n        for (_, record) in &selected {\n            miseprintln!(\"Interrupted operation {}\", record.checkpoint.uuid);\n            if let Some(operation) = &record.checkpoint.operation {\n                let paths = operation\n                    .journal\n                    .iter()\n                    .filter_map(|entry| match entry {\n                        JournalEntry::PathChanged { path, .. } => Some(path),\n                        _ => None,\n                    })\n                    .collect::<BTreeSet<_>>();\n                for path in paths {\n                    miseprintln!(\"  {}\", crate::file::display_path(path));\n                }\n            }\n        }\n        if selected.len() > 1 && (self.keep_current || self.operation.is_some()) {\n            bail!(\"select one operation by its identifier before accepting current files\");\n        }\n        if self.keep_current\n            && !self.yes\n            && !crate::ui::prompt::confirm(\n                \"Keep these live files and discard this operation's temporary recovery copies?\",\n            )?\n            .is_yes()\n        {\n            info!(\"dotfiles: recovery copies preserved\");\n            return Ok(());\n        }\n        for (_, record) in selected {\n            scope::recover_operation(&store, tracked, &record.checkpoint.uuid, self.keep_current)?;\n            if store::list_pending_in(store.state_dir())?\n                .iter()\n                .any(|(_, pending)| pending.checkpoint.uuid == record.checkpoint.uuid)\n            {\n                bail!(","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/dotfiles/recover.rs#L61-L97","documentation":"Thrown by the recover routine when the selection resolved to more than one pending operation but the user also asked to keep current files (--keep-current) or named an operation filter — ambiguous multi-operation recovery. The keep-current acceptance path only makes sense for a single operation.","triggerScenarios":"Running `mise bootstrap dotfiles history --recover --keep-current` (or with an --operation selector that matches multiple records) when `selected.len() > 1`.","commonSituations":"Several interrupted operations pending at once and the user passes a broad selector or none; scripts that add --keep-current while multiple recoveries are outstanding.","solutions":["Recover operations one at a time, passing the exact operation identifier each time","Drop --keep-current to let the interactive prompt handle each operation, or use --yes to accept defaults","Run `--pending` first to see how many operations are outstanding"],"exampleFix":"// before\nmise bootstrap dotfiles history --recover --keep-current  # matches 2 ops\n// after\nmise bootstrap dotfiles history --recover <op-id-1> --keep-current\nmise bootstrap dotfiles history --recover <op-id-2> --keep-current","handlingStrategy":"validation","validationCode":"# recover --keep-current only for a single, explicitly named operation\nCOUNT=$(mise bootstrap dotfiles history --pending | wc -l)\nif [ \"$COUNT\" -gt 1 ]; then\n  echo \"recover operations individually\" >&2; exit 1\nfi\nmise bootstrap dotfiles history --recover \"$OP_ID\" --keep-current","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair --keep-current with an explicit operation identifier","Handle multi-operation pending states one at a time","Use --yes only in non-interactive scripts with a single operation"],"tags":["cli","dotfiles","recovery","ambiguity"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}