jdx/mise · error
cannot determine whether {url} is a setup repository: {reaso
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 by opening a temporary Store and inspecting its default branch. If the store reports itself unavailable (e.g. git missing or unusable), the probe cannot decide, so it fails with this error embedding both the URL and the reason.
Source
Thrown at src/system/history/sync/onboard.rs:145
let Some(enrolled) = tracked.entry_for(local) else {
return Ok(None);
};
Ok(
(enrolled.tree_path(local)? == branch_path && tracked.would_capture(local)?)
.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) -> 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 afd2eddd3a)
Solutions
- Install git (or fix the broken git binary) so Store::open_in can open a working repository.
- Run `git --version` to confirm git is on PATH and executable.
- If git is present, inspect the store's unavailable() reason in the error message for environment-specific problems (e.g. permissions, config errors) and fix that cause.
- If the URL is simply not a setup repository and git is fine, the function returns Ok(None) instead — no error — so an error here always indicates an environment problem, not a wrong URL.
Example fix
// before probing in CI
if which::which("git").is_err() {
eprintln!("git is required to probe setup repositories");
std::process::exit(1);
}
let outcome = onboard::from_git(&url, yes, dry_run).await?; Defensive patterns
Strategy: validation
Validate before calling
// bail early with a clear message when git is missing
if which::which("git").is_err() {
eprintln!("git must be installed to probe setup repositories");
std::process::exit(1);
} Try / catch
match from_git(&url, yes, dry_run).await {
Err(e) if e.to_string().starts_with("cannot determine whether") => {
eprintln!("environment cannot probe: {} — check git availability", e);
}
other => other?,
} Prevention
- Install git in minimal containers/CI images that run the adopt flow.
- Verify `git --version` works before invoking onboarding/probing commands.
- Treat this error as an environment issue, not a wrong-URL issue.
- Surface the embedded `reason` to users instead of retrying blindly.
When it happens
Trigger: Calling from_git(url, yes, dry_run) when Store::open_in on the fresh probe tempdir reports an unavailable() reason — most commonly git not being installed or not functioning in the environment.
Common situations: Running the adopt/onboarding flow in a minimal container or CI image without git; a broken git binary on PATH; an environment where the temp probe directory cannot be initialized.
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
- cannot check staged changes: git is unavailable
- too many inherited Git configuration entries
- executable identity contains an unsupported environment vari
- remote task path is not a regular file or directory: {}
- cannot encode #{value.class} as JSON
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/9b848700c640fad3.
Report an issue: GitHub.