1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-15 13:43:45 +01:00
git/Documentation/technical
Tanay Abhra 3c8687a73e add config_set API for caching config-like files
Currently `git_config()` uses a callback mechanism and file rereads for
config values. Due to this approach, it is not uncommon for the config
files to be parsed several times during the run of a git program, with
different callbacks picking out different variables useful to themselves.

Add a `config_set`, that can be used to construct an in-memory cache for
config-like files that the caller specifies (i.e., files like `.gitmodules`,
`~/.gitconfig` etc.). Add two external functions `git_configset_get_value`
and `git_configset_get_value_multi` for querying from the config sets.
`git_configset_get_value` follows `last one wins` semantic (i.e. if there
are multiple matches for the queried key in the files of the configset the
value returned will be the last entry in `value_list`).
`git_configset_get_value_multi` returns a list of values sorted in order of
increasing priority (i.e. last match will be at the end of the list). Add
type specific query functions like `git_configset_get_bool` and similar.

Add a default `config_set`, `the_config_set` to cache all key-value pairs
read from usual config files (repo specific .git/config, user wide
~/.gitconfig, XDG config and the global /etc/gitconfig). `the_config_set`
is populated using `git_config()`.

Add two external functions `git_config_get_value` and
`git_config_get_value_multi` for querying in a non-callback manner from
`the_config_set`. Also, add type specific query functions that are
implemented as a thin wrapper around the `config_set` API.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-29 14:29:56 -07:00
..
.gitignore
api-allocation-growing.txt
api-argv-array.txt
api-builtin.txt
api-config.txt add config_set API for caching config-like files 2014-07-29 14:29:56 -07:00
api-credentials.txt
api-decorate.txt
api-diff.txt
api-directory-listing.txt
api-gitattributes.txt
api-grep.txt
api-hashmap.txt hashmap: add string interning API 2014-07-07 13:56:38 -07:00
api-history-graph.txt
api-in-core-index.txt
api-index-skel.txt
api-index.sh
api-lockfile.txt
api-merge.txt
api-object-access.txt
api-parse-options.txt
api-quote.txt
api-ref-iteration.txt
api-remote.txt
api-revision-walking.txt
api-run-command.txt
api-setup.txt
api-sha1-array.txt
api-sigchain.txt
api-strbuf.txt Merge branch 'jm/api-strbuf-doc' 2014-06-20 13:12:11 -07:00
api-string-list.txt string-list: add string_list initializer helper function 2014-07-21 10:23:36 -07:00
api-trace.txt api-trace.txt: add trace API documentation 2014-07-13 21:25:21 -07:00
api-tree-walking.txt
api-xdiff-interface.txt
bitmap-format.txt
http-protocol.txt Merge branch 'ye/doc-http-proto' 2014-06-25 12:23:52 -07:00
index-format.txt read-cache: split-index mode 2014-06-13 11:49:39 -07:00
pack-format.txt
pack-heuristics.txt
pack-protocol.txt
protocol-capabilities.txt
protocol-common.txt
racy-git.txt
send-pack-pipeline.txt
shallow.txt
trivial-merge.txt