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 5a80e97c82 config: add git_die_config() to the config-set API
Add `git_die_config` that dies printing the line number and the file name
of the highest priority value for the configuration variable `key`. A custom
error message is also printed before dying, specified by the caller, which can
be skipped if `err` argument is set to NULL.

It has usage in non-callback based config value retrieval where we can
raise an error and die if there is a semantic error.
For example,

	if (!git_config_get_value(key, &value)){
		if (!strcmp(value, "foo"))
			git_config_die(key, "value: `%s` is illegal", value);
		else
			/* do work */
	}

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-07 11:40:25 -07:00
..
.gitignore
api-allocation-growing.txt
api-argv-array.txt argv-array: drop "detach" code 2014-05-15 09:49:12 -07:00
api-builtin.txt docs: document RUN_SETUP_GENTLY and clarify RUN_SETUP 2014-04-30 11:28:21 -07:00
api-config.txt config: add git_die_config() to the config-set API 2014-08-07 11:40:25 -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 run-command: store an optional argv_array 2014-05-15 09:49:09 -07:00
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