git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 0/4] submodule config lookup API

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jun 2, 2015, 14:24 UTC
Message-ID
<20150602142436.GA7713@book.hvoigt.net>

Since there were no other comments than style fixes here is another iteration. The last iteration can be found here:

http://article.gmane.org/gmane.comp.version-control.git/269611

I found there is a merge conflict with master so I rebased this series to master.

The interdiff to last iteration contains nothing spectacular:
diff --git a/submodule-config.c b/submodule-config.c
index 177767d..199692b 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -27,7 +27,7 @@ struct submodule_entry {
 
 enum lookup_type {
 	lookup_name,
-	lookup_path,
+	lookup_path
 };
 
 static struct submodule_cache cache;
@@ -390,12 +390,12 @@ static const struct submodule *config_from(struct submodule_cache *cache,
 		return submodule;
 
 	switch (lookup_type) {
-		case lookup_name:
-			submodule = cache_lookup_name(cache, sha1, key);
-			break;
-		case lookup_path:
-			submodule = cache_lookup_path(cache, sha1, key);
-			break;
+	case lookup_name:
+		submodule = cache_lookup_name(cache, sha1, key);
+		break;
+	case lookup_path:
+		submodule = cache_lookup_path(cache, sha1, key);
+		break;
 	}
 	if (submodule)
 		return submodule;
@@ -419,12 +419,12 @@ static const struct submodule *config_from(struct submodule_cache *cache,
 	free(config);
 
 	switch (lookup_type) {
-		case lookup_name:
-			submodule = cache_lookup_name(cache, sha1, key);
-			break;
-		case lookup_path:
-			submodule = cache_lookup_path(cache, sha1, key);
-			break;
+	case lookup_name:
+		submodule = cache_lookup_name(cache, sha1, key);
+		break;
+	case lookup_path:
+		submodule = cache_lookup_path(cache, sha1, key);
+		break;
 	}
 
 	return submodule;
diff --git a/submodule-config.h b/submodule-config.h
index 58afc83..9061e4e 100644
--- a/submodule-config.h
+++ b/submodule-config.h
@@ -24,6 +24,6 @@ const struct submodule *submodule_from_name(const unsigned char *commit_sha1,
 		const char *name);
 const struct submodule *submodule_from_path(const unsigned char *commit_sha1,
 		const char *path);
-void submodule_free();
+void submodule_free(void);
 
 #endif /* SUBMODULE_CONFIG_H */


Heiko Voigt (4):
  implement submodule config cache for lookup of submodule names
  extract functions for submodule config set and lookup
  use new config API for worktree configurations of submodules
  do not die on error of parsing fetchrecursesubmodules option

 .gitignore                                       |   1 +
 Documentation/technical/api-submodule-config.txt |  63 +++
 Makefile                                         |   2 +
 builtin/checkout.c                               |   1 +
 builtin/fetch.c                                  |   1 +
 diff.c                                           |   1 +
 submodule-config.c                               | 484 +++++++++++++++++++++++
 submodule-config.h                               |  29 ++
 submodule.c                                      | 122 ++----
 submodule.h                                      |   4 +-
 t/t7411-submodule-config.sh                      | 153 +++++++
 test-submodule-config.c                          |  76 ++++
 12 files changed, 839 insertions(+), 98 deletions(-)
 create mode 100644 Documentation/technical/api-submodule-config.txt
 create mode 100644 submodule-config.c
 create mode 100644 submodule-config.h
 create mode 100755 t/t7411-submodule-config.sh
 create mode 100644 test-submodule-config.c
-- 
2.4.2.391.g2979c89
Next: Heiko Voigt
Message 1 of 7 in “submodule config lookup API”
  1. 0/4 submodule config lookup APIHeiko Voigt, Jun 2, 2015
  2. 1/4 implement submodule config cache for lookup of submodule namesHeiko Voigt, Jun 2, 2015
  3. Junio C HamanoJun 2, 2015
  4. Heiko VoigtJun 3, 2015
  5. 2/4 extract functions for submodule config set and lookupHeiko Voigt, Jun 2, 2015
  6. 3/4 use new config API for worktree configurations of submodulesHeiko Voigt, Jun 2, 2015
  7. 4/4 do not die on error of parsing fetchrecursesubmodules optionHeiko Voigt, Jun 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.