{"record":{"id":"9b848700c640fad3","repo":"jdx/mise","slug":"cannot-determine-whether-url-is-a-setup-reposito","errorCode":null,"errorMessage":"cannot determine whether {url} is a setup repository: {reason}","messagePattern":"cannot determine whether (.+?) is a setup repository: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/onboard.rs","lineNumber":157,"sourceCode":"            .then(|| relative.to_path_buf()),\n    )\n}\n\n/// `mise bootstrap --adopt <url>`: `Some` when the repository is\n/// history-managed and this machine was set up from it (or would be, on a\n/// dry run); `None` leaves the ordinary clone to the caller.\npub(crate) async fn from_git(\n    url: &str,\n    yes: bool,\n    dry_run: bool,\n    replace_history: bool,\n) -> Result<Option<Outcome>> {\n    // Detect marked repositories without creating persistent tracking state\n    // for users of the released, ordinary --adopt workflow.\n    let probe_dir = tempfile::tempdir()?;\n    let store = Store::open_in(probe_dir.path())?;\n    if let Some(reason) = store.unavailable() {\n        bail!(\"cannot determine whether {url} is a setup repository: {reason}\");\n    }\n    let repo = store\n        .repo()\n        .ok_or_else(|| eyre::eyre!(\"probing a setup repository requires git\"))?;\n    let Some(branch) = default_branch(&Remote::new(repo, url))? else {\n        return Ok(None);\n    };\n    if !matches!(probe(&store, url, &branch)?, RepoState::Marked(_)) {\n        return Ok(None);\n    }\n    let store = Store::open()?;\n    if let Some(reason) = store.unavailable() {\n        bail!(\"cannot onboard this setup repository: history is unavailable: {reason}\");\n    }\n    refuse_other_connection(&store, url, &branch)?;\n    let outcome = run(\n        &store,\n        &Onboarding {","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/onboard.rs#L139-L175","documentation":"from_git probes whether a remote URL is a marked setup repository without creating persistent local state. It opens a temporary probe Store; if that store reports itself unavailable (typically because required tooling like git is missing or broken), the library cannot even determine the repository's nature and bails with the URL and reason embedded in the message.","triggerScenarios":"Calling from_git when Store::open_in(probe_dir).unavailable() returns Some(reason) — usually the git binary is not installed or not on PATH, or the embedded store failed to initialize in the probe temp dir.","commonSituations":"Fresh machine or CI image without git installed; git present but broken/incompatible; restricted environments where spawning git fails (permissions, PATH sanitization).","solutions":["Install git and ensure it is on PATH (git --version should work), then retry the onboarding command","Read the {reason} in the error message for the specific store-unavailable cause and fix that","If PATH is sanitized (cron, restricted shells), export PATH to include git before running the tool"],"exampleFix":"# before\n$ mise history onboard https://host/org/repo.git\nError: cannot determine whether https://host/org/repo.git is a setup repository: git not found\n# after\n$ apt-get install git   # or brew install git; ensure `git --version` works\n$ mise history onboard https://host/org/repo.git","handlingStrategy":"fallback","validationCode":"// before probing, verify git availability\nif which(\"git\").is_err() {\n    return Err(\"git must be installed and on PATH to probe setup repositories\");\n}","typeGuard":null,"tryCatchPattern":"match Outcome::from_git(url) {\n    Err(e) if e.to_string().starts_with(\"cannot determine whether\") => {\n        eprintln!(\"{e}\");\n        eprintln!(\"hint: install git and ensure it is on PATH, then retry\");\n        std::process::exit(1);\n    }\n    other => other?,\n}","preventionTips":["Check `git --version` succeeds before running onboarding in CI images","Keep PATH intact when spawning the tool from cron or restricted shells","Fix the store-unavailable reason surfaced in the message rather than retrying blindly"],"tags":["git","dependency","environment"],"backgroundTag":"missing-dependency","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"}