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

[PATCH] fixup! config: arbitrary number of matches for --unset and --replace-all

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 6, 2013, 18:46 UTC
Message-ID
<1386355602-21818-1-git-send-email-gitster@pobox.com>
In-Reply-To
<06ba1524cbe4fa31b6e1a8d644882521aeaff4f4.1384337608.git.tr@thomasrast.ch>
---
 * I'll squash this to tr/config-multivalue-lift-max in preparation
   for merging it to 'master',which should happen by the end of
   this week.
   Thanks.
 config.c                |  8 ++++----
 t/t1303-wacky-config.sh | 14 +++++++-------
 2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/config.c b/config.c
index 431dcb7..a1e80da 100644
--- a/config.c
+++ b/config.c
@@ -1192,7 +1192,7 @@ static int store_aux(const char *key, const char *value, void *cb)
 				warning("%s has multiple values", key);
 			}
 
-			ALLOC_GROW(store.offset, store.seen+1,
+			ALLOC_GROW(store.offset, store.seen + 1,
 				   store.offset_alloc);
 
 			store.offset[store.seen] = cf->do_ftell(cf);
@@ -1222,14 +1222,14 @@ static int store_aux(const char *key, const char *value, void *cb)
 		 * Do not increment matches: this is no match, but we
 		 * just made sure we are in the desired section.
 		 */
-		ALLOC_GROW(store.offset, store.seen+1,
+		ALLOC_GROW(store.offset, store.seen + 1,
 			   store.offset_alloc);
 		store.offset[store.seen] = cf->do_ftell(cf);
 		/* fallthru */
 	case SECTION_END_SEEN:
 	case START:
 		if (matches(key, value)) {
-			ALLOC_GROW(store.offset, store.seen+1,
+			ALLOC_GROW(store.offset, store.seen + 1,
 				   store.offset_alloc);
 			store.offset[store.seen] = cf->do_ftell(cf);
 			store.state = KEY_SEEN;
@@ -1239,7 +1239,7 @@ static int store_aux(const char *key, const char *value, void *cb)
 			      !strncmp(key, store.key, store.baselen)) {
 					store.state = SECTION_SEEN;
 					ALLOC_GROW(store.offset,
-						   store.seen+1,
+						   store.seen + 1,
 						   store.offset_alloc);
 					store.offset[store.seen] = cf->do_ftell(cf);
 			}
diff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh
index 7d55730..3a2c819 100755
--- a/t/t1303-wacky-config.sh
+++ b/t/t1303-wacky-config.sh
@@ -66,13 +66,13 @@ setup_many() {
 	# Semi-efficient way of concatenating 5^5 = 3125 lines. Note
 	# that because 'setup' already put one line, this means 3126
 	# entries for section.key in the config file.
-	cat >5to1 <<EOF
-  key = foo
-  key = foo
-  key = foo
-  key = foo
-  key = foo
-EOF
+	cat >5to1 <<-\EOF &&
+	  key = foo
+	  key = foo
+	  key = foo
+	  key = foo
+	  key = foo
+	EOF
 	cat 5to1 5to1 5to1 5to1 5to1 >5to2 &&	   # 25
 	cat 5to2 5to2 5to2 5to2 5to2 >5to3 &&	   # 125
 	cat 5to3 5to3 5to3 5to3 5to3 >5to4 &&	   # 635
-- 
1.8.5.1-402-gdd8f092
Previous: Thomas RastNext: Jeff King
Message 7 of 8 in “Bug with git svn fetch? "error:too many matches for svn-remote.svn.added-placeholder"”
  1. Jess HottensteinNov 5, 2013
  2. config: arbitrary number of matches for --unset and --replace-allThomas Rast, Nov 13, 2013
  3. Eric SunshineNov 13, 2013
  4. config: arbitrary number of matches for --unset and --replace-allThomas Rast, Nov 14, 2013
  5. Jeff KingNov 14, 2013
  6. Thomas RastNov 14, 2013
  7. fixup! config: arbitrary number of matches for --unset and --replace-allJunio C Hamano, Dec 6, 2013
  8. Jeff KingDec 6, 2013

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.