git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 2ff490794fec532120c1d0aaf8a12ee0fcef4215 1423 bytes (raw)
name: Documentation/technical/api-submodule-config.txt 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
submodule config cache API
==========================

The submodule config cache API allows to read submodule
configurations/information from specified revisions. Internally
information is lazily read into a cache that is used to avoid
unnecessary parsing of the same .gitmodule files. Lookups can be done by
submodule path or name.

Usage
-----

The caller can look up information about submodules by using the
`submodule_from_path()` or `submodule_from_name()` functions. They return
a `struct submodule` which contains the values. The API automatically
initializes and allocates the needed infrastructure on-demand.

If the internal cache might grow too big or when the caller is done with
the API, all internally cached values can be freed with submodule_free().

Data Structures
---------------

`struct submodule`::

	This structure is used to return the information about one
	submodule for a certain revision. It is returned by the lookup
	functions.

Functions
---------

`void submodule_free()`::

	Use these to free the internally cached values.

`const struct submodule *submodule_from_path(const unsigned char *commit_sha1, const char *path)`::

	Lookup values for one submodule by its commit_sha1 and path or
	name.

`const struct submodule *submodule_from_name(const unsigned char *commit_sha1, const char *name)`::

	The same as above but lookup by name.

For an example usage see test-submodule-config.c.

debug log:

solving 2ff4907 ...
found 2ff4907 in https://public-inbox.org/git/20140605060750.GC23874@sandbox-ub/ ||
	https://public-inbox.org/git/20140628100120.GB89729@book.hvoigt.net/ ||
	https://public-inbox.org/git/20150602142538.GB7713@book.hvoigt.net/ ||
	https://public-inbox.org/git/20150521170725.GB22979@book.hvoigt.net/ ||
	https://public-inbox.org/git/ef740bdea9af35564c75efd2a6daae65f3108df5.1434400625.git.hvoigt@hvoigt.net/

applying [1/1] https://public-inbox.org/git/20140605060750.GC23874@sandbox-ub/
diff --git a/Documentation/technical/api-submodule-config.txt b/Documentation/technical/api-submodule-config.txt
new file mode 100644
index 0000000..2ff4907

Checking patch Documentation/technical/api-submodule-config.txt...
Applied patch Documentation/technical/api-submodule-config.txt cleanly.

skipping https://public-inbox.org/git/20140628100120.GB89729@book.hvoigt.net/ for 2ff4907
skipping https://public-inbox.org/git/20150602142538.GB7713@book.hvoigt.net/ for 2ff4907
skipping https://public-inbox.org/git/20150521170725.GB22979@book.hvoigt.net/ for 2ff4907
skipping https://public-inbox.org/git/ef740bdea9af35564c75efd2a6daae65f3108df5.1434400625.git.hvoigt@hvoigt.net/ for 2ff4907
index at:
100644 2ff490794fec532120c1d0aaf8a12ee0fcef4215	Documentation/technical/api-submodule-config.txt

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).