Support safely (read-only) syncing .git directories
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 32/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- git
- 领域
- desktop
调研方向
首先阅读 issue #130,并检查现有的 file-sync 会话设置及其 UI。确定同步模式和被忽略目录的配置方式,然后定义只读 .git 同步所需的面向用户的方向和文档,包括完成时如何传达同步方向及其中的权衡。
由索引模型根据 Issue 内容生成。
描述
Git was not developed with bi-directional file syncing of the metadata in mind - it doesn't expect anything other than the local git process to modify its contents, be it the git config folder or the index. As such, Coder Desktop doesn't sync .git directories.
This is also explained in the Mutagen documentation: https://mutagen.io/documentation/synchronization/version-control-systems/
However, it's not uncommon or unreasonable to want git available on both machines.
On the local machine, the git metadata is obviously required to use Git IDE integrations, but on the workspace it may be required in build scripts, such as to populate version strings from Git tags. Or, it may be the case that the workspace is the only machine authorised to push to the remote.
Whilst we can't include the .git directory in the bidirectional sync session, Mutagen supports the one-way-replica sync mode, where conflicts cannot happen, and changes made to one side immediately replace the contents on the other. We can use this to mitigate these issues, but not without a few caveats:
- The
.git/indexfile is going to be deleted and recreated on the side it is being synced to each time a git operation is performed. On repos with a large number of files, this will affect the performance of git commands, as it first has to recreate that index.- We can work around this by ignoring
.git/index, but this doesn't change the fact that the staged/unstaged files will never be synchronised on both sides. (Though what's staged/unstaged on the side being copied to is irrelevant, this may be confusing to see).
- We can work around this by ignoring
- Whilst the Git metadata on the side being synced to will be read-only, the behavior when attempting to make changes on that side is undefined. In my testing I found that git just errors when attempting to switch branch or make a commit, as the file IDs stored in the config don't match those in the
index. Whilst this appears consistent, we have no guarantees this is always the case. - The user still needs to be conscious about which side of the file sync the repository is cloned to. If they need to be able to push from the workspace, they need to clone on the workspace (or perform a one time cut & paste of
.git, which is fine), and vice versa.
There's two ways we can approach this:
- Add a file sync checkbox to additionally create this
one-way-replicasync of the.gitdirectory excluding theindexfile. - Support configuring both the sync mode, and ignored directories when creating sync sessions (#130), allowing users to manually setup this workflow.
Supporting one-way syncs via either approach will also require an update to the UI to indicate which way the sync is.
Regardless of the method, there's a lot we have to communicate to the user about what's going on. They need to be aware of the tradeoffs of this approach, and inform them how to best set up their workflow. With the first approach, we'll likely need to link to documentation, and with the second we'll need to direct the user to documentation to learn how to set up their file-sync.
Unfortunately, there's no approach here that 'just works', that doesn't require the user to be aware of what's going on. For that reason I think the second approach is preferable, as it requires the user to be explicit about how they set up their workflow.
Sibling issue of https://github.com/coder/coder-desktop-macos/issues/164
- 主要语言
- C#
- 星标
- 29
- 派生
- 12
- 平均合并
- 1 小时 40 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/coder-desktop-windows 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
coder/coder-desktop-windows#166 ·
-
bug
难度 3/5 1-2 天 新手友好度 52/100
coder/coder-desktop-windows#179 · 3 条评论 ·
-
bug coder-desktop networking
难度 4/5 3-5 天 新手友好度 48/100
coder/coder-desktop-windows#177 · 2 条评论 ·
-
Tray reports Coder Connect as healthy while tunnel/DNS is broken; stale NRPT rule causes downstream tooling to hang or fail可能重新可做 @aslilac 于 54 天前认领,目前没有进行中的 PR。 未关闭bug coder-desktop
coder/coder-desktop-windows#171 · 1 条评论 · 已指派 1 人 ·
-
bug github-sync
难度 4/5 3-5 天 新手友好度 38/100
coder/coder-desktop-windows#170 ·
查看 coder/coder-desktop-windows 的全部 Issue
相似的 Issue
-
:watch: Not Triaged async-task-programming/subsvc dotnet-csharp/svc
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
Python: Bug: AnnotationContent and StreamingAnnotationContent to_element writes CitationType.X, so annotations in a rendered chat history fail to parse可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/semantic-kernel#14590 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
Needs-Triage
难度 1/5 1 小时以内 新手友好度 88/100
PowerShell/PowerShell#28194 ·
维护者通常 1 天内回复
-
AI Projects Client customer-reported needs-team-attention question Service Attention
难度 2/5 1-3 小时 新手友好度 70/100
Azure/azure-sdk-for-net#63804 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复