-
-
Notifications
You must be signed in to change notification settings - Fork 419
Open
Description
Description
Add support for the GIT_OPTIONAL_LOCKS environment variable, which allows skipping operations that require locks.
Background
The GIT_OPTIONAL_LOCKS environment variable, when set to 0, tells Git to skip operations that would normally require file locks. This is useful for read-only scenarios or when multiple processes need to access a repository simultaneously.
Use Case in Dulwich
This would be valuable for Dulwich users who:
- Run read-only operations in environments where locking might fail
- Need concurrent access to repositories from multiple processes
- Work in containerized or restricted environments where file locking is problematic
Implementation Notes
This would require checking the environment variable before attempting to acquire locks on repository files, gracefully skipping lock-dependent operations when set to 0.