{"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":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/recover.rs","lineNumber":77,"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":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/recover.rs#L59-L95","documentation":"`mise dot recover` with `--keep-current` (accepting current live files) or an operation selector requires exactly one matching pending operation. If more than one record matched, the intent is ambiguous, so it bails.","triggerScenarios":"Running `mise dot recover --keep-current` (or with an operation id) when `selected.len() > 1` — the selector matched multiple pending operations or no selector was given but several are pending.","commonSituations":"Multiple interrupted operations pending after several failed runs; combining --keep-current with a pattern that matches several records; forgetting to pass the specific operation identifier.","solutions":["Pass the exact operation identifier: `mise dot recover <id> --keep-current`","Resolve/recover pending operations one at a time until only one remains","Run `mise dot history --pending` to see which operations are pending and pick one","Drop --keep-current if you want a different bulk behavior (with confirmation)"],"exampleFix":"# before\nmise dot recover --keep-current  # 3 pending ops\n# after\nmise dot recover 3f2a... --keep-current  # select one by id","handlingStrategy":"validation","validationCode":"pending=$(mise dot history --pending)\ncount=$(echo \"$pending\" | grep -c '^' )\nif [ \"$count\" -gt 1 ] && [ -z \"${OP_ID:-}\" ]; then echo \"select one operation id\"; exit 1; fi","typeGuard":null,"tryCatchPattern":"if ! mise dot recover --keep-current 2>/dev/null; then\n  mise dot recover \"$(mise dot history --pending | head -1 | awk '{print $1}')\" --keep-current\nfi","preventionTips":["Always pass the operation identifier when multiple ops may be pending","Drain pending operations one at a time","Don't combine --keep-current with ambiguous selectors","Check `mise dot history --pending` count before bulk recovery"],"tags":["cli","dotfiles","recovery","ambiguity","selection"],"backgroundTag":"mutually-exclusive-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"}