{"record":{"id":"323a2797967a5e54","repo":"jdx/mise","slug":"not-connected","errorCode":null,"errorMessage":"not connected","messagePattern":"not connected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/system/history/sync/origin.rs","lineNumber":192,"sourceCode":"            differing.len()\n        );\n        for path in differing.iter().take(10) {\n            miseprintln!(\"  differs: {path}\");\n        }\n    }\n    miseprintln!(\n        \"All committed versions of explicitly tracked files are eligible for synchronization. Untracking does not erase earlier versions.\"\n    );\n    let config_dir = crate::system::history::tracked::global_config_dir();\n    if config_dir.join(\".git\").exists() {\n        miseprintln!(\n            \"{} is a git checkout: enabling history does not convert or migrate it; applied files appear there as ordinary working-tree changes.\",\n            display_path(&config_dir)\n        );\n    }\n    let mut status = run::read_status(state_dir)?;\n    if !confirmed(opts.yes, \"Connect this setup repository?\")? {\n        bail!(\"not connected\");\n    }\n    *accepted = true;\n\n    // the mode is recorded only when it differs from what the settings\n    // say, so `mise settings set history.sync …` keeps working afterwards\n    let mode =\n        (opts.mode.as_str() != crate::config::Settings::get().history.sync).then_some(opts.mode);\n    write_config(&opts.url, &branch, mode)?;\n    // another repository or branch starts from a clean slate: the previous\n    // one's per-path state, pending changes, and conflicts would read its\n    // absence of a file as a deletion\n    if connected_before && !same_origin {\n        reset_sync_state(repo)?;\n        status = run::SyncStatus::default();\n        info!(\n            \"history: a different setup repository; the previous one's sync state is discarded (local checkpoints are kept)\"\n        );\n    }","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/origin.rs#L174-L210","documentation":"Connecting a setup repository requires explicit user confirmation at the 'Connect this setup repository?' prompt. If the user declines (or confirmation is absent), `set_inner` aborts with 'not connected' and no connection is recorded.","triggerScenarios":"`mise dot origin set` reaches `confirmed(opts.yes, ...)` and returns false — the user answered no, or a non-interactive invocation did not supply `--yes`.","commonSituations":"User hesitates and answers 'n'; scripted/CI invocation lacking a TTY without the `--yes` flag; wrong repository shown in the prompt prompting a deliberate decline.","solutions":["Re-run the command and answer yes at the prompt","Add the `--yes` flag to skip interactive confirmation","Verify the repository URL before connecting if the decline was intentional"],"exampleFix":"// before\nmise dot origin set <url>\n// after: non-interactive\nmise dot origin set <url> --yes","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string() == \"not connected\" => eprintln!(\"connection declined; re-run with --yes to connect non-interactively\"),\n    _ => {}\n}","preventionTips":["Pass --yes for scripted connections","Answer the prompt deliberately after checking the displayed repository","Run in an interactive TTY when connecting"],"tags":["cli","git","user-confirmation","abort"],"backgroundTag":"missing-required-flag","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"}