{"record":{"id":"f6bc11078ec35836","repo":"zed-industries/zed","slug":"missing-query-path","errorCode":null,"errorMessage":"missing query path","messagePattern":"missing query path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_context/src/git_log_context.rs","lineNumber":141,"sourceCode":"    }\n}\n\n#[allow(dead_code)]\nfn run() -> Result<()> {\n    let mut arguments = env::args_os();\n    let program_name = arguments\n        .next()\n        .and_then(|path| PathBuf::from(path).file_name().map(|name| name.to_owned()))\n        .and_then(|name| name.into_string().ok())\n        .unwrap_or_else(|| \"git_log_context\".to_string());\n\n    let worktree_dir = arguments.next().ok_or_else(|| {\n        print_usage(&program_name);\n        anyhow!(\"missing worktree path\")\n    })?;\n    let query_path = arguments.next().ok_or_else(|| {\n        print_usage(&program_name);\n        anyhow!(\"missing query path\")\n    })?;\n    if arguments.next().is_some() {\n        print_usage(&program_name);\n        bail!(\"too many arguments\");\n    }\n\n    let worktree_dir = PathBuf::from(worktree_dir);\n    let query_path = normalize_query_path(&worktree_dir, &PathBuf::from(query_path));\n    let index = futures::executor::block_on(build_git_log_index(&worktree_dir))?;\n\n    for (path, count) in index.get_related_with_counts(&query_path, 10) {\n        println!(\"{count}\\t{}\", path.display());\n    }\n\n    Ok(())\n}\n\n#[allow(dead_code)]","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_context/src/git_log_context.rs#L123-L159","documentation":"The git_log_context CLI was invoked with a worktree path but no second positional argument, the query path. run() requires exactly two positional args; this sentinel error is returned after printing usage and the process exits with FAILURE before any repository access.","triggerScenarios":"Thrown at crates/edit_prediction_context/src/git_log_context.rs:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the query path as the second positional argument after the worktree path","Verify argument ordering — usage is printed on stderr when this fails"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}