Support safely (read-only) syncing .git directories
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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
- 平均マージ
- 4時間 15分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/coder-desktop-windows のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
coder/coder-desktop-windows#166 ·
-
CoderVPN Unsigned オープン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 件 ·
-
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
-
untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
type/automation type/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
newrelic/newrelic-dotnet-agent#3850 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
LuckyPennySoftware/AutoMapper#4660 ·