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

Re: [PATCH 2/5] implement submodule config cache for lookup of submodule names

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jun 13, 2014, 22:37 UTC
Message-ID
<20140613223701.GA3799@sandbox-ub>
In-Reply-To
<xmqq38f96b9f.fsf@gitster.dls.corp.google.com>
On Thu, Jun 12, 2014 at 02:58:20PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> Heiko Voigt <hvoigt@hvoigt.net> writes:
> 
> > ...
> > +static int is_cache_init = 0;
> 
> Please don't initialise variables in the .bss to zero by hand.
Ok will remove that.
Show 17 quoted lines
> > + ...
> > +	warning("%s:.gitmodules, multiple configurations found for "
> > +			"submodule.%s.%s. Skipping second one!",
> > +			commit_string, name, option);
> > +}
> > + ...
> > +		if (strcmp(value, "untracked") && strcmp(value, "dirty") &&
> > +		    strcmp(value, "all") && strcmp(value, "none")) {
> > +			warning("Invalid parameter \"%s\" for config option "
> > +					"\"submodule.%s.ignore\"", value, var);
> > +			goto release_return;
> > +		}
> 
> These two look inconsistent in different ways.  I think we typically
> quote the names like so:
> 
> 	warning("I have trouble with variable '%s' somehow", var);
Ok will change the quotation for the variable and parameter names.
Here is the fixup[1] I will queue in my branch.
Cheers Heiko
[1] ---8<----
Subject: [PATCH] fixup! implement submodule config cache for lookup of
 submodule names
---
 submodule-config.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/submodule-config.c b/submodule-config.c
index 437fbdb..f330ccc 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -26,7 +26,7 @@ struct submodule_entry {
 };
 
 static struct submodule_cache cache;
-static int is_cache_init = 0;
+static int is_cache_init;
 
 static int config_path_cmp(const struct submodule_entry *a,
 			   const struct submodule_entry *b,
@@ -230,7 +230,7 @@ static void warn_multiple_config(const unsigned char *commit_sha1,
 	if (commit_sha1)
 		commit_string = sha1_to_hex(commit_sha1);
 	warning("%s:.gitmodules, multiple configurations found for "
-			"submodule.%s.%s. Skipping second one!",
+			"'submodule.%s.%s'. Skipping second one!",
 			commit_string, name, option);
 }
 
@@ -298,8 +298,8 @@ static int parse_config(const char *var, const char *value, void *data)
 		}
 		if (strcmp(value, "untracked") && strcmp(value, "dirty") &&
 		    strcmp(value, "all") && strcmp(value, "none")) {
-			warning("Invalid parameter \"%s\" for config option "
-					"\"submodule.%s.ignore\"", value, var);
+			warning("Invalid parameter '%s' for config option "
+					"'submodule.%s.ignore'", value, var);
 			goto release_return;
 		}
 
-- 
2.0.0
Previous: Junio C HamanoNext: Heiko Voigt
Message 16 of 26 in “submodule config lookup API”
  1. 0/5 submodule config lookup APIHeiko Voigt, Jun 5, 2014
  2. 1/5 hashmap: add enum for hashmap free_entries optionHeiko Voigt, Jun 5, 2014
  3. Karsten BleesJun 6, 2014
  4. Heiko VoigtJun 10, 2014
  5. Karsten BleesJun 11, 2014
  6. Junio C HamanoJun 12, 2014
  7. Karsten BleesJun 17, 2014
  8. Heiko VoigtJun 17, 2014
  9. Junio C HamanoJun 17, 2014
  10. 2/5 implement submodule config cache for lookup of submodule namesHeiko Voigt, Jun 5, 2014
  11. W. Trevor KingJun 5, 2014
  12. Heiko VoigtJun 6, 2014
  13. Eric SunshineJun 8, 2014
  14. Heiko VoigtJun 10, 2014
  15. Junio C HamanoJun 12, 2014
  16. Heiko VoigtJun 13, 2014
  17. 3/5 extract functions for submodule config set and lookupHeiko Voigt, Jun 5, 2014
  18. 4/5 use new config API for worktree configurations of submodulesHeiko Voigt, Jun 5, 2014
  19. 5/5 do not die on error of parsing fetchrecursesubmodules optionHeiko Voigt, Jun 5, 2014
  20. Junio C HamanoJun 12, 2014
  21. Heiko VoigtJun 13, 2014
  22. Junio C HamanoJun 16, 2014
  23. Heiko VoigtJun 17, 2014
  24. Junio C HamanoJun 12, 2014
  25. Jens LehmannJun 13, 2014
  26. Junio C HamanoJun 13, 2014

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.