{"record":{"id":"54ed7b7baa0ad349","repo":"astrid-runtime/astrid","slug":"git-history-requires-name-repo-relative-path","errorCode":null,"errorMessage":"--git-history requires NAME=REPO::RELATIVE_PATH","messagePattern":"--git-history requires NAME=REPO::RELATIVE_PATH","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-chunker-evidence/src/main.rs","lineNumber":207,"sourceCode":"    targets_kib.sort_unstable();\n    targets_kib.dedup();\n    Ok(Options {\n        corpus_specs,\n        version_chain_specs,\n        git_history_specs,\n        include_synthetic,\n        sketch_only,\n        targets_kib,\n        output,\n    })\n}\n\nfn parse_git_specification(specification: Option<String>) -> Result<(String, PathBuf, PathBuf)> {\n    let (name, combined) = parse_path_specification(\"--git-history\", specification)?;\n    let combined = combined.to_string_lossy();\n    let (repository, relative_path) = combined\n        .split_once(\"::\")\n        .ok_or_else(|| anyhow::anyhow!(\"--git-history requires NAME=REPO::RELATIVE_PATH\"))?;\n    if repository.is_empty() || relative_path.is_empty() {\n        bail!(\"--git-history requires non-empty NAME=REPO::RELATIVE_PATH\");\n    }\n    Ok((\n        name,\n        PathBuf::from(repository),\n        PathBuf::from(relative_path),\n    ))\n}\n\nfn parse_path_specification(\n    flag: &str,\n    specification: Option<String>,\n) -> Result<(String, PathBuf)> {\n    let specification =\n        specification.ok_or_else(|| anyhow::anyhow!(\"{flag} requires NAME=PATH\"))?;\n    let (name, path) = specification\n        .split_once('=')","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-chunker-evidence/src/main.rs#L189-L225","documentation":"Format error in `parse_git_specification`: the `--git-history` value, after the mandatory `NAME=PATH` split, has no `::` separator. The value must be `NAME=REPO::RELATIVE_PATH`; the parser needs both the repository path and the in-repo relative path to walk git history, and refuses an ambiguous or malformed spec.","triggerScenarios":"Passing `--git-history NAME=/path/to/repo` (single `=`, no `::`), or forgetting the `::RELATIVE_PATH` part entirely. (An empty repo or relative path segment raises the sibling 'non-empty' bail at main.rs:209.)","commonSituations":"Confusing `--git-history` syntax with `--corpus`/`--version-chain` (which only need `NAME=PATH`); shell quoting stripping or mangling the `::`; copying an example without the relative path.","solutions":["Format the value as `NAME=REPO::RELATIVE_PATH`, e.g. `--git-history kernel=/src/repo::crates/kernel`.","Quote the argument in the shell so `::` is preserved.","Cross-check the syntax in `--help` output (`--git-history NAME=REPO::RELATIVE_PATH`)."],"exampleFix":"// before\nmybin --git-history kernel=/src/repo\n// after\nmybin --git-history 'kernel=/src/repo::crates/kernel'","handlingStrategy":"validation","validationCode":"fn valid_git_spec(spec: &str) -> bool {\n    let (_n, rest) = spec.split_once('=').unwrap_or((\"\", \"\"));\n    match rest.split_once(\"::\") {\n        Some((repo, rel)) => !repo.is_empty() && !rel.is_empty(),\n        None => false,\n    }\n}","typeGuard":null,"tryCatchPattern":"let spec = \"kernel=/src/repo::crates/kernel\";\nassert!(valid_git_spec(spec), \"--git-history requires NAME=REPO::RELATIVE_PATH\");","preventionTips":["Remember --git-history needs the extra `::RELATIVE_PATH` segment unlike --corpus.","Quote the argument so shell parsing preserves `::`.","Match against the --help usage line before running long scans."],"tags":["cli","rust","git","argument-parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}