1 submodule config cache API
2 ==========================
4 The submodule config cache API allows to read submodule
5 configurations/information from specified revisions. Internally
6 information is lazily read into a cache that is used to avoid
7 unnecessary parsing of the same .gitmodule files. Lookups can be done by
8 submodule path or name.
13 The caller can look up information about submodules by using the
14 `submodule_from_path()` or `submodule_from_name()` functions. They return
15 a `struct submodule` which contains the values. The API automatically
16 initializes and allocates the needed infrastructure on-demand.
18 If the internal cache might grow too big or when the caller is done with
19 the API, all internally cached values can be freed with submodule_free().
26 This structure is used to return the information about one
27 submodule for a certain revision. It is returned by the lookup
33 `void submodule_free()`::
35 Use these to free the internally cached values.
37 `const struct submodule *submodule_from_path(const unsigned char *commit_sha1, const char *path)`::
39 Lookup values for one submodule by its commit_sha1 and path.
41 `const struct submodule *submodule_from_name(const unsigned char *commit_sha1, const char *name)`::
43 The same as above but lookup by name.
45 For an example usage see test-submodule-config.c.