{"record":{"id":"dbd9d0747725bc3b","repo":"zed-industries/zed","slug":"git-log-command-failed-with-dbd9d0","errorCode":null,"errorMessage":"git log command failed with {}: {}","messagePattern":"git log command failed with (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":3376,"sourceCode":"                    }\n                }\n\n                return Ok(());\n            }\n\n            if git_binary.is_trusted {\n                let git_binary = git_binary.envs(HashMap::clone(&env));\n                git_binary\n                    .run(&[\"hook\", \"run\", \"--ignore-missing\", hook.as_str()])\n                    .await?;\n            }\n            Ok(())\n        }\n        .boxed()\n    }\n\n    fn initial_graph_data(\n        &self,\n        log_source: LogSource,\n        log_order: LogOrder,\n        request_tx: Sender<Vec<Arc<InitialGraphCommitData>>>,\n    ) -> BoxFuture<'_, Result<()>> {\n        let git = self.git_binary();\n\n        async move {\n            let log_source_args = log_source.get_args();\n            let mut git_log_command = vec![\"log\", GRAPH_COMMIT_FORMAT, log_order.as_arg()];\n            git_log_command.extend(log_source_args.iter().map(|arg| arg.as_ref()));\n            let mut command = git.build_command(&git_log_command);\n            command.stdout(Stdio::piped());\n            command.stderr(Stdio::piped());\n\n            let mut child = command.spawn()?;\n            let stdout = child.stdout.take().context(\"failed to get stdout\")?;\n            let stderr = child.stderr.take().context(\"failed to get stderr\")?;\n            let mut reader = BufReader::new(stdout);","sourceCodeStart":3358,"sourceCodeEnd":3394,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L3358-L3394","documentation":"Error from `initial_graph_data` when the streaming `git log` process that populates the initial commit graph exits non-zero. The first placeholder is the process exit status; the second is the collected stderr. When stderr is empty, a variant without the stderr portion is emitted instead. Typically indicates an invalid log source revision range or a broken repository.","triggerScenarios":"`fatal: your current branch ... does not have any commits yet` on an unborn HEAD; `fatal: bad object` from a corrupt or shallow object store; invalid revision arguments; permission errors reading objects; repository mid-repack or mid-rebase manipulation.","commonSituations":"Requesting history for a brand-new branch with zero commits; partial/shallow clones missing objects; interrupted clones; custom log filters referencing paths or refs that do not exist.","solutions":["Read the stderr portion of the message and act on it directly.","Treat `does not have any commits yet` as empty history, not as a hard error.","If stderr says `bad object`, repair or re-clone; for shallow clones consider `git fetch --unshallow`.","Validate user-supplied revisions and path filters before starting the log stream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// unborn HEAD has no history\nif git.run(&[\"rev-parse\", \"--verify\", \"--quiet\", \"HEAD\"]).await.is_err() {\n    return Ok(Vec::new());\n}","typeGuard":null,"tryCatchPattern":"match log_result {\n    Err(e) if e.to_string().contains(\"does not have any commits yet\") => {\n        Ok(Vec::new()) // unborn branch: empty history\n    }\n    Err(e) if e.to_string().contains(\"bad object\") => {\n        // corrupt/shallow store: suggest fetch --unshallow or re-clone\n        Err(e)\n    }\n    other => other?,\n}","preventionTips":["Check HEAD exists before streaming log for freshly created branches.","Validate user-supplied revisions and path filters before spawning git log.","Unshallow or fully fetch clones whose history you intend to browse."],"tags":["git","log","subprocess","stderr"],"backgroundTag":"git-command-failed","analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}