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.
Showing the changes to src (1 of 12 files). Show all
Unified · Split
| @@ -125,7 +125,10 @@ static GIT_CONFIG: &[Record] = &[ · 124 unmodified lines | |||
| 125 | }, | 125 | }, |
| 126 | Record { | 126 | Record { |
| 127 | config: "core.deltaBaseCacheLimit", | 127 | 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 | } | ||
| 129 | }, | 132 | }, |
| 130 | Record { | 133 | Record { |
| 131 | config: "core.bigFileThreshold", | 134 | config: "core.bigFileThreshold", |
| @@ -845,6 +848,13 @@ static GIT_CONFIG: &[Record] = &[ · 713 unmodified lines | |||
| 845 | deviation: Some("corresponds to the EMAIL environment variable and is a fallback for `user.email`") | 848 | deviation: Some("corresponds to the EMAIL environment variable and is a fallback for `user.email`") |
| 846 | } | 849 | } |
| 847 | }, | 850 | }, |
| 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 | }, | ||
| 848 | ]; | 858 | ]; |
| 849 | 859 | ||
| 850 | /// A programmatic way to record and display progress. | 860 | /// A programmatic way to record and display progress. |