[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.137.185.202: ~ $
config API
==========

The config API gives callers a way to access Git configuration files
(and files which have the same syntax). See linkgit:git-config[1] for a
discussion of the config file syntax.

General Usage
-------------

Config files are parsed linearly, and each variable found is passed to a
caller-provided callback function. The callback function is responsible
for any actions to be taken on the config option, and is free to ignore
some options. It is not uncommon for the configuration to be parsed
several times during the run of a Git program, with different callbacks
picking out different variables useful to themselves.

A config callback function takes three parameters:

- the name of the parsed variable. This is in canonical "flat" form: the
  section, subsection, and variable segments will be separated by dots,
  and the section and variable segments will be all lowercase. E.g.,
  `core.ignorecase`, `diff.SomeType.textconv`.

- the value of the found variable, as a string. If the variable had no
  value specified, the value will be NULL (typically this means it
  should be interpreted as boolean true).

- a void pointer passed in by the caller of the config API; this can
  contain callback-specific data

A config callback should return 0 for success, or -1 if the variable
could not be parsed properly.

Basic Config Querying
---------------------

Most programs will simply want to look up variables in all config files
that Git knows about, using the normal precedence rules. To do this,
call `git_config` with a callback function and void data pointer.

`git_config` will read all config sources in order of increasing
priority. Thus a callback should typically overwrite previously-seen
entries with new ones (e.g., if both the user-wide `~/.gitconfig` and
repo-specific `.git/config` contain `color.ui`, the config machinery
will first feed the user-wide one to the callback, and then the
repo-specific one; by overwriting, the higher-priority repo-specific
value is left at the end).

The `git_config_with_options` function lets the caller examine config
while adjusting some of the default behavior of `git_config`. It should
almost never be used by "regular" Git code that is looking up
configuration variables. It is intended for advanced callers like
`git-config`, which are intentionally tweaking the normal config-lookup
process. It takes two extra parameters:

`filename`::
If this parameter is non-NULL, it specifies the name of a file to
parse for configuration, rather than looking in the usual files. Regular
`git_config` defaults to `NULL`.

`respect_includes`::
Specify whether include directives should be followed in parsed files.
Regular `git_config` defaults to `1`.

There is a special version of `git_config` called `git_config_early`.
This version takes an additional parameter to specify the repository
config, instead of having it looked up via `git_path`. This is useful
early in a Git program before the repository has been found. Unless
you're working with early setup code, you probably don't want to use
this.

Reading Specific Files
----------------------

To read a specific file in git-config format, use
`git_config_from_file`. This takes the same callback and data parameters
as `git_config`.

Value Parsing Helpers
---------------------

To aid in parsing string values, the config API provides callbacks with
a number of helper functions, including:

`git_config_int`::
Parse the string to an integer, including unit factors. Dies on error;
otherwise, returns the parsed result.

`git_config_ulong`::
Identical to `git_config_int`, but for unsigned longs.

`git_config_bool`::
Parse a string into a boolean value, respecting keywords like "true" and
"false". Integer values are converted into true/false values (when they
are non-zero or zero, respectively). Other values cause a die(). If
parsing is successful, the return value is the result.

`git_config_bool_or_int`::
Same as `git_config_bool`, except that integers are returned as-is, and
an `is_bool` flag is unset.

`git_config_maybe_bool`::
Same as `git_config_bool`, except that it returns -1 on error rather
than dying.

`git_config_string`::
Allocates and copies the value string into the `dest` parameter; if no
string is given, prints an error message and returns -1.

`git_config_pathname`::
Similar to `git_config_string`, but expands `~` or `~user` into the
user's home directory when found at the beginning of the path.

Include Directives
------------------

By default, the config parser does not respect include directives.
However, a caller can use the special `git_config_include` wrapper
callback to support them. To do so, you simply wrap your "real" callback
function and data pointer in a `struct config_include_data`, and pass
the wrapper to the regular config-reading functions. For example:

-------------------------------------------
int read_file_with_include(const char *file, config_fn_t fn, void *data)
{
	struct config_include_data inc = CONFIG_INCLUDE_INIT;
	inc.fn = fn;
	inc.data = data;
	return git_config_from_file(git_config_include, file, &inc);
}
-------------------------------------------

`git_config` respects includes automatically. The lower-level
`git_config_from_file` does not.

Writing Config Files
--------------------

TODO

Filemanager

Name Type Size Permission Actions
api-allocation-growing.html File 17.55 KB 0644
api-allocation-growing.txt File 1019 B 0644
api-argv-array.html File 19.44 KB 0644
api-argv-array.txt File 2.12 KB 0644
api-builtin.html File 19.43 KB 0644
api-builtin.txt File 2 KB 0644
api-config.html File 23.39 KB 0644
api-config.txt File 5.18 KB 0644
api-credentials.html File 27.9 KB 0644
api-credentials.txt File 8.87 KB 0644
api-decorate.html File 16.23 KB 0644
api-decorate.txt File 60 B 0644
api-diff.html File 24.32 KB 0644
api-diff.txt File 5.22 KB 0644
api-directory-listing.html File 20.75 KB 0644
api-directory-listing.txt File 2.71 KB 0644
api-gitattributes.html File 21.9 KB 0644
api-gitattributes.txt File 3.62 KB 0644
api-grep.html File 16.31 KB 0644
api-grep.txt File 76 B 0644
api-hash.html File 18.42 KB 0644
api-hash.txt File 1.4 KB 0644
api-hashmap.html File 35.57 KB 0644
api-hashmap.txt File 7.71 KB 0644
api-history-graph.html File 24.08 KB 0644
api-history-graph.txt File 5.9 KB 0644
api-in-core-index.html File 16.96 KB 0644
api-in-core-index.txt File 457 B 0644
api-index-skel.txt File 431 B 0644
api-index.html File 18.45 KB 0644
api-index.sh File 611 B 0644
api-index.txt File 1.68 KB 0644
api-lockfile.html File 20.05 KB 0644
api-lockfile.txt File 2.92 KB 0644
api-merge.html File 21.36 KB 0644
api-merge.txt File 3.3 KB 0644
api-object-access.html File 16.73 KB 0644
api-object-access.txt File 342 B 0644
api-parse-options.html File 31.03 KB 0644
api-parse-options.txt File 9.36 KB 0644
api-quote.html File 16.42 KB 0644
api-quote.txt File 145 B 0644
api-ref-iteration.html File 19.71 KB 0644
api-ref-iteration.txt File 2.41 KB 0644
api-remote.html File 21.26 KB 0644
api-remote.txt File 3.3 KB 0644
api-revision-walking.html File 19.76 KB 0644
api-revision-walking.txt File 2.39 KB 0644
api-run-command.html File 28.25 KB 0644
api-run-command.txt File 8.08 KB 0644
api-setup.html File 16.51 KB 0644
api-setup.txt File 180 B 0644
api-sha1-array.html File 19.39 KB 0644
api-sha1-array.txt File 2.25 KB 0644
api-sigchain.html File 17.74 KB 0644
api-sigchain.txt File 1.34 KB 0644
api-strbuf.html File 32.15 KB 0644
api-strbuf.txt File 10.17 KB 0644
api-string-list.html File 26.42 KB 0644
api-string-list.txt File 6.84 KB 0644
api-tree-walking.html File 23.17 KB 0644
api-tree-walking.txt File 4.27 KB 0644
api-xdiff-interface.html File 16.3 KB 0644
api-xdiff-interface.txt File 139 B 0644
index-format.html File 27.12 KB 0644
index-format.txt File 6.29 KB 0644
pack-format.html File 24.08 KB 0644
pack-format.txt File 5.54 KB 0644
pack-heuristics.html File 42.74 KB 0644
pack-heuristics.txt File 17.77 KB 0644
pack-protocol.html File 43.12 KB 0644
pack-protocol.txt File 20.99 KB 0644
protocol-capabilities.html File 25.41 KB 0644
protocol-capabilities.txt File 7.09 KB 0644
protocol-common.html File 20.08 KB 0644
protocol-common.txt File 2.7 KB 0644
racy-git.html File 26.85 KB 0644
racy-git.txt File 8.63 KB 0644
send-pack-pipeline.html File 18.73 KB 0644
send-pack-pipeline.txt File 1.92 KB 0644
shallow.html File 18.86 KB 0644
shallow.txt File 2.3 KB 0644
trivial-merge.html File 21.62 KB 0644
trivial-merge.txt File 4.16 KB 0644