[Feature] 远程工作区支持从上级目录开始的 Git 仓库(打开 monorepo 子目录时 Git 可用)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
Línea de trabajo
Start by reading desktop/internal/workbench/remote_git.go, especially remoteRepositoryAbove, and the test TestRemoteWorkspaceSaysItsRepositoryStartsAbove plus the string desktop.remote.workspace.gitAbove that currently only shows the "repository starts above" message. On the Core side, find where the remote scope bounds the workspace's host folder and where git.* requests are validated, so git rev-parse --show-toplevel can admit one extra repo-root prefix, then check remote.runWatch allows watching it and how remoteplaceholder.LocalPath maps to .lithe-remote-host. Done means changes outside the folder are listed, stageable, diffable and committable from the commit window while remaining unopenable in the remote editor, with the trust question for an outside repo root flagged for the #2231 security series.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem to solve / 要解决的问题
远程工作区打开的主机文件夹如果位于一个从上级目录开始的 Git 仓库里(例如打开 ~/work/repo/service,而仓库根是 ~/work/repo),信任文件夹后 Git 视图不能用:Core 在主机上返回的仓库根在工作区占位目录之外,变更路径是相对仓库根的,和项目树(以主机文件夹为根)对不上。#2231 接缝④ 的 PR 里先让 Git 和提交工具窗口说明“仓库从上级目录开始,请打开仓库顶层文件夹”,不显示变更、不记为失败。用户在主机上习惯只打开 monorepo 的一个子目录时,只能改为打开整个仓库。
本机项目已经支持这种布局(本机的 Git 视图按仓库根解析路径,打开子目录也能看到并提交变更),远程工作区落后于本机。
Proposed solution / 建议方案
- 远程绑定只覆盖主机文件夹本身。让 Git 能读写文件夹以外的仓库根,需要 Core 的远程作用域允许
git.*请求访问“该工作区所在仓库的根”这一个额外前缀(由 Core 在主机上用git rev-parse --show-toplevel解析并校验,不接受客户端给出的任意路径),并在返回的路径里把仓库根下、文件夹外的路径映射到占位目录旁的保留前缀(桌面端remoteplaceholder.LocalPath已有.lithe-remote-host映射)。 - 桌面端的 Git、提交、日志、差异、逐行追溯按仓库根解析路径:文件夹内的变更照常定位到项目树;文件夹外的变更在提交窗口里列出(可暂存、提交、查看差异),但不能在编辑器里打开(远程编辑器只读写文件夹内的文件),并说明原因。
- git 目录的主机监听已按 Core 给出的 git 目录工作,仓库根在文件夹外时同样适用;需要确认
remote.runWatch允许监听该前缀。 - 远程信任:信任决定仍按主机文件夹记录;仓库根在文件夹外时,是否要求同时信任仓库根需要按 Zed 的安全设计(#2231 的 S 系列)单独评估,因为 Git 钩子和配置来自仓库根。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
Remote and WSL / 远程与 WSL
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
- 打开子目录时自动改为打开仓库根:会让项目树和用户选择的文件夹不一致,也会扩大远程信任的范围,不采用。
- 桌面端自己把文件夹外的路径过滤掉、只显示文件夹内的变更:提交时会遗漏文件夹外已暂存的内容,用户看不到将被提交的全部变更,不安全,不采用。
Additional context / 补充信息
- 当前行为与提示文案在 #2231 接缝④ 的 PR 中实现:
desktop/internal/workbench/remote_git.go的remoteRepositoryAbove,测试TestRemoteWorkspaceSaysItsRepositoryStartsAbove,词条desktop.remote.workspace.gitAbove。 - 关联 #2231(远程开发完整设计)。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 151
- Merge medio
- 3 h 48 min
- PR fusionados (30 d)
- 571
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de 1lck/Lithe-IDEA
-
review: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
1lck/Lithe-IDEA#2432 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
1lck/Lithe-IDEA#2431 ·
Los mantenedores suelen responder en 1 día
-
refactor review: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
1lck/Lithe-IDEA#2376 ·
Los mantenedores suelen responder en 1 día
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
1lck/Lithe-IDEA#2365 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
1lck/Lithe-IDEA#2434 ·
Los mantenedores suelen responder en 1 día
Todos los issues de 1lck/Lithe-IDEA
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
posit-dev/positron-sas-extension#196 ·
Los mantenedores suelen responder en 1 día
-
bug composer
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
inmanta/web-console#8037 ·
Los mantenedores suelen responder en 1 día
-
Add: AlFajer Palestine FHDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtimeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día