{"record":{"id":"2d0d6a4ea6decf2a","repo":"jdx/mise","slug":"a-repository-url-is-required","errorCode":null,"errorMessage":"a repository url is required","messagePattern":"a repository url is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/origin.rs","lineNumber":78,"sourceCode":"            );\n            return Err(match result {\n                Err(err) => err.wrap_err(message),\n                Ok(()) => eyre::eyre!(message),\n            });\n        }\n    }\n    result\n}\n\nasync fn set_inner(\n    store: &Store,\n    tracked: &TrackedSet,\n    opts: &SetOptions,\n    accepted: &mut bool,\n    preview_lock: &mut Option<fslock::LockFile>,\n) -> Result<()> {\n    if opts.url.trim().is_empty() {\n        bail!(\"a repository url is required\");\n    }\n    let repo = store\n        .repo()\n        .ok_or_else(|| eyre::eyre!(\"connecting a setup repository requires git\"))?;\n    let state_dir = store.state_dir();\n    // the connection as it was: another repository or branch starts from a\n    // clean slate, and a scheme change on the same one replaces its refs\n    let status_before = run::read_status(state_dir)?;\n    // This is the disposable preview repository. The connected repository's\n    // remote-tracking ref remains untouched unless the connection is confirmed.\n    let remote = Remote::new(repo, &opts.url);\n    // re-running the same connection keeps the branch it already has, so an\n    // unattended `origin set <url> --yes` stays idempotent when the\n    // repository's default branch is not the one this machine follows\n    let connected = (!status_before.disconnected\n        && status_before.origin_url.as_deref() == Some(opts.url.as_str()))\n    .then_some(status_before.origin_branch.as_deref())\n    .flatten();","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/origin.rs#L60-L96","documentation":"`mise dot origin set` requires a repository URL to connect to. `set_inner` validates `opts.url` and bails immediately if it is empty or whitespace-only, since connecting to a blank remote is meaningless.","triggerScenarios":"Running `mise dot origin set` with no URL argument or with an empty/blank string as the URL.","commonSituations":"Forgetting the positional URL argument; a shell variable holding the remote URL is unset (`mise dot origin set \"$REMOTE\"` with empty REMOTE); copy-paste dropped the URL.","solutions":["Pass the repository URL explicitly: `mise dot origin set git@github.com:user/repo.git`","Fix the shell variable so it contains the actual remote URL","Run `git remote get-url origin` in the target repo to obtain the correct URL"],"exampleFix":"// before\nmise dot origin set \"$REMOTE\"   # REMOTE empty\n// after\nmise dot origin set git@github.com:user/repo.git","handlingStrategy":"validation","validationCode":"let url = std::env::var(\"REMOTE\").unwrap_or_default();\nif url.trim().is_empty() {\n    eprintln!(\"REMOTE is empty; pass a repository url to `mise dot origin set`\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"a repository url is required\") => eprintln!(\"usage: mise dot origin set <url>\"),\n    _ => {}\n}","preventionTips":["Always pass the URL as an explicit positional argument","Guard shell variables with ${REMOTE:?} so empty values fail fast","Verify with `git remote get-url origin` when unsure of the URL"],"tags":["cli","git","missing-argument"],"backgroundTag":"missing-required-argument","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"}