History

feat!: represent object cache configuration like `GITOXIDE_PACK_CACHE_MEMORY` in git-configuration.

That way there is a unified system for how to set values, which may be overridable by configuration variables or not. With this changes, the explicit application of environment variables for setting the cache isn't required anymore as everything happens using git-configuration, and automatically, while providing full control like before.

Sebastian Thiel committed 3 years ago

Commit becbd8d1 parent a4ac9cf12 files · +151 −86Browse files

Showing the changes to src (1 of 12 files). Show all

Unified · Split

src/plumbing/progress.rs+11−1
@@ -125,7 +125,10 @@ static GIT_CONFIG: &[Record] = &[ · 124 unmodified lines
125125 },
126126 Record {
127127 config: "core.deltaBaseCacheLimit",
128− usage: NotApplicable { reason: "we use a small 64 slot pack delta cache by default, which can be replaced with larger caches as determined by the algorithm. This keeps memory usage low and is fast enough" }
128+ usage: InModule {
129+ name: "repository::cache",
130+ deviation: Some("if unset, we default to a small 64 slot fixed-size cache that holds at most 64 full delta base objects of any size. Overridable by 'GITOXIDE_PACK_CACHE_MEMORY'. Set to 0 to deactivate it entirely.")
131+ }
129132 },
130133 Record {
131134 config: "core.bigFileThreshold",
@@ -845,6 +848,13 @@ static GIT_CONFIG: &[Record] = &[ · 713 unmodified lines
845848 deviation: Some("corresponds to the EMAIL environment variable and is a fallback for `user.email`")
846849 }
847850 },
851+ Record {
852+ config: "gitoxide.objects.cacheLimit",
853+ usage: InModule {
854+ name: "repository::cache",
855+ deviation: Some("corresponds to the GITOXIDE_OBJECT_CACHE_MEMORY environment variable. If unset or 0, there is no object cache")
856+ }
857+ },
848858 ];
849859
850860 /// A programmatic way to record and display progress.