{"record":{"id":"763b6f317049400a","repo":"zed-industries/zed","slug":"file-history-changed-files-is-only-supported-local","errorCode":null,"errorMessage":"file history changed files is only supported locally","messagePattern":"file history changed files is only supported locally","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":7036,"sourceCode":"    }\n\n    pub fn file_history_changed_files(\n        &mut self,\n        paths: Vec<RepoPath>,\n        commit_limit: usize,\n    ) -> oneshot::Receiver<Result<Vec<FileHistoryChangedFileSets>>> {\n        self.send_job(\n            \"file_history_changed_files\",\n            None,\n            move |git_repo, _cx| async move {\n                match git_repo {\n                    RepositoryState::Local(LocalRepositoryState { backend, .. }) => {\n                        backend\n                            .file_history_changed_files(paths, commit_limit)\n                            .await\n                    }\n                    RepositoryState::Remote(_) => {\n                        anyhow::bail!(\"file history changed files is only supported locally\")\n                    }\n                }\n            },\n        )\n    }\n\n    pub fn get_graph_data(\n        &self,\n        log_source: LogSource,\n        log_order: LogOrder,\n    ) -> Option<&InitialGitGraphData> {\n        self.initial_graph_data.get(&(log_source, log_order))\n    }\n\n    pub fn search_commits(\n        &mut self,\n        log_source: LogSource,\n        search_args: SearchCommitArgs,","sourceCodeStart":7018,"sourceCodeEnd":7054,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/project/src/git_store.rs#L7018-L7054","documentation":"Zed's GitStore executes the file_history_changed_files job against the local git backend only (crates/project/src/git_store.rs:7036). In remote development sessions the repository is a RepositoryState::Remote, which has no local backend to compute changed-file sets from, so the job fails immediately rather than returning incorrect history.","triggerScenarios":"Calling GitStore::file_history_changed_files(paths, commit_limit) while the project's repository state is RepositoryState::Remote - i.e. invoking the file-history changed-files feature, or any extension wrapping it, inside an SSH/remote development session.","commonSituations":"Remote (SSH) projects where the worktree lives on the remote host; extensions or custom tooling written against local-only git APIs; local-git code paths reused in remote sessions.","solutions":["Guard the call: only invoke file_history_changed_files when the worktree is local (worktree.read(cx).is_local())","Hide or disable the file-history UI entry point for remote repositories, like other local-only git operations","For remote hosts, run the equivalent git command outside Zed on the remote machine"],"exampleFix":"// before\nlet sets = git_store.file_history_changed_files(paths, commit_limit, cx).await?;\n\n// after\nif worktree.read(cx).is_local() {\n    let sets = git_store.file_history_changed_files(paths, commit_limit, cx).await?;\n}","handlingStrategy":"validation","validationCode":"let is_local = worktree.read(cx).is_local();\nif !is_local {\n    // Skip: local-only git operation on a remote repository\n    return Ok(Vec::new());\n}","typeGuard":"fn is_local_repository(worktree: &Entity<Worktree>, cx: &App) -> bool {\n    worktree.read(cx).is_local()\n}","tryCatchPattern":"match git_store.file_history_changed_files(paths, commit_limit, cx).await {\n    Ok(sets) => { /* ... */ }\n    Err(err) if err.to_string().contains(\"only supported locally\") => {\n        // degrade gracefully in remote sessions instead of propagating\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Check worktree.is_local() before invoking any GitStore job documented as local-only","Treat RepositoryState::Remote as a first-class case when porting local git features to remote projects"],"tags":["git","remote-dev","file-history","unsupported-operation"],"backgroundTag":"remote-unsupported-operation","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}