{"record":{"id":"99f2100899a4325f","repo":"nikivdev/code","slug":"unable-to-parse-github-repo-from","errorCode":null,"errorMessage":"unable to parse GitHub repo from: {}","messagePattern":"unable to parse GitHub repo from: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/home.rs","lineNumber":820,"sourceCode":"    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"https://github.com/\") {\n        return parse_owner_repo(rest, RepoScheme::Https);\n    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"http://github.com/\") {\n        return parse_owner_repo(rest, RepoScheme::Https);\n    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"github.com/\") {\n        return parse_owner_repo(rest, RepoScheme::Https);\n    }\n\n    if trimmed.contains('/') {\n        return parse_owner_repo(trimmed, RepoScheme::Https);\n    }\n\n    bail!(\"unable to parse GitHub repo from: {}\", input)\n}\n\nfn parse_owner_repo(raw: &str, scheme: RepoScheme) -> Result<RepoInput> {\n    let cleaned = raw.trim().trim_end_matches(\".git\").trim_end_matches('/');\n    let mut parts = cleaned.splitn(2, '/');\n    let owner = parts.next().unwrap_or(\"\").trim();\n    let repo = parts.next().unwrap_or(\"\").trim();\n    if owner.is_empty() || repo.is_empty() {\n        bail!(\"unable to parse GitHub repo from: {}\", raw);\n    }\n\n    let clone_url = match scheme {\n        RepoScheme::Https => format!(\"https://github.com/{}/{}.git\", owner, repo),\n        RepoScheme::Ssh => format!(\"git@github.com:{}/{}.git\", owner, repo),\n    };\n\n    Ok(RepoInput {\n        owner: owner.to_string(),","sourceCodeStart":802,"sourceCodeEnd":838,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/home.rs#L802-L838","documentation":"parse_repo_input falls through all recognized formats (git@github.com:..., HTTPS GitHub URLs, owner/repo shorthand) and, if the input contains no '/' and matches no known pattern, cannot determine owner and repo. It bails showing the original input. Only GitHub repository identifiers are supported.","triggerScenarios":"Passing a bare repo name without owner (e.g. \"kar\"), a non-GitHub URL whose parsing yields no owner/repo split, or a malformed string that strip/parse steps leave unrecognizable while it contains no '/'.","commonSituations":"Typing just the repo name instead of owner/repo; pointing at GitLab/Bitbucket URLs which the GitHub-only parser can't decompose into the expected form; typos like `github.comowner/repo`; pasting a repo web page path with extra segments that parse_owner_repo then rejects.","solutions":["Use the `owner/repo` shorthand form","Use a full GitHub URL: https://github.com/owner/repo (or .git suffix)","Use SSH form: git@github.com:owner/repo.git","If targeting a non-GitHub host, host a GitHub mirror or extend parse_repo_input"],"exampleFix":"// before\nf home sync --repo kar\n// after\nf home sync --repo owner/kar","handlingStrategy":"validation","validationCode":"fn looks_like_repo_input(s: &str) -> bool {\n    let t = s.trim().trim_end_matches('/');\n    t.starts_with(\"git@github.com:\") || t.contains(\"github.com\") || (t.contains('/') && !t.contains(\"://\")) || t.split('/').count() == 2\n}","typeGuard":"fn as_owner_repo(s: &str) -> Option<(String, String)> {\n    let t = s.trim().trim_end_matches('/').trim_end_matches(\".git\");\n    let t = t.strip_prefix(\"git@github.com:\").unwrap_or(t);\n    let t = t.strip_prefix(\"https://github.com/\").unwrap_or(t);\n    let mut p = t.splitn(2, '/');\n    let o = p.next()?; let r = p.next()?;\n    if o.is_empty() || r.is_empty() { None } else { Some((o.into(), r.into())) }\n}","tryCatchPattern":"match parse_repo_input(input) {\n    Err(e) if e.to_string().starts_with(\"unable to parse GitHub repo\") => {\n        eprintln!(\"use 'owner/repo' or https://github.com/owner/repo for '{}'\", input);\n    }\n    r => r?,\n}","preventionTips":["Always include the owner: use owner/repo, not the bare repo name","Only GitHub URLs are supported; mirror other hosts to GitHub first","Normalize URLs (strip .git, trailing slashes) before passing them in"],"tags":["validation","git","parsing"],"backgroundTag":"repo-url-unparseable","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}