Detect Busy Git Repositories and Delay Sync to Prevent Corruption
I would like to suggest a feature that would significantly improve reliability when working with Git repositories inside Proton Drive.
Problem:
Git operations (commit, checkout, rebase, merge, gc, etc.) modify many files inside the .git directory and are not atomic at the directory level. If Proton Drive syncs the repository while such an operation is in progress, this can result in corrupted repositories, broken working copies, or inconsistent history.
Suggested Solution:
When Proton Drive detects that a directory is a Git repository (contains a .git folder), the sync client should delay syncing that directory while the repository is “busy”.
Simple detection method:
A Git repository is in use when lock files exist, especially:
.git/index.lock
.git/HEAD.lock
.git/packed-refs.lock
.git/config.lock
.git/shallow.lock
If any of these files exist, Proton Drive should temporarily skip syncing that repository and retry later.
More robust method (used by some sync clients):
Detect file activity in .git/objects/ and pack files (.pack, .idx)
Wait until no changes occur in the .git directory for a certain time (e.g., 10–30 seconds)
Then start syncing
Why this matters:
Many developers store working directories inside Proton Drive. Syncing during active Git operations is a common cause of repository corruption with cloud sync tools. Delaying sync while a repo is busy would prevent data loss and reduce sync conflicts.
This change would make Proton Drive much safer and more attractive for developers.