jdx/mise · error

cannot determine whether

Error message

cannot determine whether {url} is a setup repository: {reason}

What it means

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.

Solutions

  1. Install git and ensure it is on PATH (git --version should work), then retry the onboarding command
  2. Read the {reason} in the error message for the specific store-unavailable cause and fix that
  3. If PATH is sanitized (cron, restricted shells), export PATH to include git before running the tool

Example fix

# before
$ mise history onboard https://host/org/repo.git
Error: cannot determine whether https://host/org/repo.git is a setup repository: git not found
# after
$ apt-get install git   # or brew install git; ensure `git --version` works
$ mise history onboard https://host/org/repo.git
Defensive patterns

Strategy: fallback

Validate before calling

// before probing, verify git availability
if which("git").is_err() {
    return Err("git must be installed and on PATH to probe setup repositories");
}

Try / catch

match Outcome::from_git(url) {
    Err(e) if e.to_string().starts_with("cannot determine whether") => {
        eprintln!("{e}");
        eprintln!("hint: install git and ensure it is on PATH, then retry");
        std::process::exit(1);
    }
    other => other?,
}

Prevention

When it happens

Trigger: 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.

Common situations: Fresh machine or CI image without git installed; git present but broken/incompatible; restricted environments where spawning git fails (permissions, PATH sanitization).

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/9b848700c640fad3. Report an issue: GitHub.

Appendix: source

Thrown at src/system/history/sync/onboard.rs:157

            .then(|| relative.to_path_buf()),
    )
}

/// `mise bootstrap --adopt <url>`: `Some` when the repository is
/// history-managed and this machine was set up from it (or would be, on a
/// dry run); `None` leaves the ordinary clone to the caller.
pub(crate) async fn from_git(
    url: &str,
    yes: bool,
    dry_run: bool,
    replace_history: bool,
) -> Result<Option<Outcome>> {
    // Detect marked repositories without creating persistent tracking state
    // for users of the released, ordinary --adopt workflow.
    let probe_dir = tempfile::tempdir()?;
    let store = Store::open_in(probe_dir.path())?;
    if let Some(reason) = store.unavailable() {
        bail!("cannot determine whether {url} is a setup repository: {reason}");
    }
    let repo = store
        .repo()
        .ok_or_else(|| eyre::eyre!("probing a setup repository requires git"))?;
    let Some(branch) = default_branch(&Remote::new(repo, url))? else {
        return Ok(None);
    };
    if !matches!(probe(&store, url, &branch)?, RepoState::Marked(_)) {
        return Ok(None);
    }
    let store = Store::open()?;
    if let Some(reason) = store.unavailable() {
        bail!("cannot onboard this setup repository: history is unavailable: {reason}");
    }
    refuse_other_connection(&store, url, &branch)?;
    let outcome = run(
        &store,
        &Onboarding {

View on GitHub (pinned to 533346cc37)