Support safely (read-only) syncing `.git` directories
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu bằng cách xem xét các phương án được đề xuất trong issue này, issue #130, và tài liệu đồng bộ hóa Mutagen được liên kết. Xác định cách cấu hình đồng bộ hóa .git một chiều, loại trừ .git/index, cũng như cách UI và tài liệu truyền đạt hướng, hành vi chỉ đọc và các đánh đổi; để hoàn thành, cần chốt một phương án vì không có tệp hoặc bài kiểm thử cụ thể nào được nêu tên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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-windows/issues/105
- Ngôn ngữ chính
- Swift
- Star
- 29
- Fork
- 9
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/coder-desktop-macos
-
Authentication fails with invalid TLS certificate error on self-hosted Coder deployment (macOS)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
coder/coder-desktop-macos#285 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
coder/coder-desktop-macos#230 · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
coder/coder-desktop-macos#221 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 48/100
coder/coder-desktop-macos#220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
coder/coder-desktop-macos#212 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của coder/coder-desktop-macos
Issue tương tự
-
area:shell order:5 status:ready type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
krystianslowik/arkt#899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted roadmap tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
🐞 bug 💠 component 🔍 triage v4 🧰 library
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Orange-OpenSource/ouds-ios#1875 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
521xueweihan/HelloGitHub#4295 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100