[PATCH V5]: `config_set` now uses a single hashmap. Corrected style nits raised
the thread. Thanks to Junio and Matthieu for their
[PATCH v4]: Introduced `config_set` construct which points to a ordered set of
config-files cached as hashmaps. Added relevant API functions. For more
details see the documentation. Rewrote the git_config_get* family to use
`config_set` internally. Added tests for both config_set API and
family. Added type specific API functions which parses the found value
converts it into a specific type.
Most of the changes implemented are the result of discussion in .
Thanks to Eric, Ramsay, Junio, Matthieu & Karsten for their suggestions
[PATCH v3]: Added flag for NULL values that were causing segfaults in some
Added test-config for usage examples.
Minor changes and corrections. Refer to discussion thread for more
Thanks to Matthieu, Jeff and Junio for their valuable suggestions.
[PATCH v2]:Changed the string_list to a struct instead of pointer to a struct.
Added string-list initilization functions.
Minor mistakes corrected acoording to review comments. Thanks to
Eric and Matthieu for their review.
[PATCH V1]:Most of the invaluable suggestions by Eric Sunshine, Torsten
Jeff King has been implemented. Complete rewrite of config_cache*()
using git_config() as hook as suggested by Jeff. Thanks for the review.
[RFC V2]: Improved according to the suggestions by Eric Sunshine and Torsten
Added cache invalidation when config file is changed.
I am using git_config_set_multivar_in_file() as an update hook.
This is patch is for this year's GSoC. My project is
"Git Config API improvements". The link of my proposal is appended below .
The aim of this patch series is to generate a cache for querying values from
the config files in a non-callback manner as the current method reads and
parses the config files every time a value is queried for.
The cache is generated from hooking the update_cache function to the current
parsing and callback mechanism in config.c. It is implemented as an hashmap
using the hashmap-api with variables and its corresponding values list as
its members. The values in the list are sorted in order of increasing priority.
The cache is initialised the first time when any of the new query functions is
called. It is invalidated by using git_config_set_multivar_in_file() as an
We add two new functions to the config-api, git_config_get_string() and
git_config_get_string_multi() for querying in a non callback manner from
Tanay Abhra (2):
.gitignore | 1 +
Documentation/technical/api-config.txt | 134 +++++++++++++++
Makefile | 2 +
cache.h | 34 ++++
config-hash.c | 297 +++++++++++++++++++++++++++++++++
config.c | 3 +
t/t1308-config-hash.sh | 187 +++++++++++++++++++++
test-config.c | 127 ++++++++++++++
8 files changed, 785 insertions(+)
create mode 100644 config-hash.c
create mode 100755 t/t1308-config-hash.sh
create mode 100644 test-config.c
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html