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

[PATCH] config.c: remove unnecessary header in minimum configuration file.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 25, 2005, 22:22 UTC
Message-ID
<7v7jawmkpo.fsf@assigned-by-dhcp.cox.net>

It is just silly to start the file called "config" with a comment that says "This is the config file."

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 config.c               |    8 --------
 t/t1300-repo-config.sh |   20 --------------------
 2 files changed, 0 insertions(+), 28 deletions(-)

applies-to: f316bfd81eaa2064c1d9e01a336eaed8d7a5bd4f 55c2454c6f18323b5ff04504593603848084aa4d

diff --git a/config.c b/config.c
index 5cc8535..52659f9 100644
--- a/config.c
+++ b/config.c
@@ -445,12 +445,6 @@ int git_config_set_multivar(const char* 
 	 * If .git/config does not exist yet, write a minimal version.
 	 */
 	if (stat(config_filename, &st)) {
-		static const char contents[] =
-			"#\n"
-			"# This is the config file\n"
-			"#\n"
-			"\n";
-
 		free(store.key);
 
 		/* if nothing to unset, error out */
@@ -461,8 +455,6 @@ int git_config_set_multivar(const char* 
 		}
 
 		store.key = (char*)key;
-
-		write(fd, contents, sizeof(contents)-1);
 		store_write_section(fd, key);
 		store_write_pair(fd, key, value);
 	} else{
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 5e994ff..207dd3d 100644
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -12,10 +12,6 @@ test -f .git/config && rm .git/config
 git-repo-config core.penguin "little blue"
 
 cat > expect << EOF
-#
-# This is the config file
-#
-
 [core]
 	penguin = little blue
 EOF
@@ -25,10 +21,6 @@ test_expect_success 'initial' 'cmp .git/
 git-repo-config Core.Movie BadPhysics
 
 cat > expect << EOF
-#
-# This is the config file
-#
-
 [core]
 	penguin = little blue
 	Movie = BadPhysics
@@ -39,10 +31,6 @@ test_expect_success 'mixed case' 'cmp .g
 git-repo-config Cores.WhatEver Second
 
 cat > expect << EOF
-#
-# This is the config file
-#
-
 [core]
 	penguin = little blue
 	Movie = BadPhysics
@@ -55,10 +43,6 @@ test_expect_success 'similar section' 'c
 git-repo-config CORE.UPPERCASE true
 
 cat > expect << EOF
-#
-# This is the config file
-#
-
 [core]
 	penguin = little blue
 	Movie = BadPhysics
@@ -76,10 +60,6 @@ test_expect_success 'replace with non-ma
 	'git-repo-config core.penguin "very blue" !kingpin'
 
 cat > expect << EOF
-#
-# This is the config file
-#
-
 [core]
 	penguin = very blue
 	Movie = BadPhysics
---
0.99.9.GIT
Next: Junio C Hamano
Message 1 of 8 in “config.c: remove unnecessary header in minimum configuration file.”
  1. config.c: remove unnecessary header in minimum configuration file.Junio C Hamano, Nov 25, 2005
  2. Junio C HamanoDec 5, 2005
  3. Andreas EricssonDec 5, 2005
  4. Johannes SchindelinDec 5, 2005
  5. Junio C HamanoDec 5, 2005
  6. Johannes SchindelinDec 5, 2005
  7. Junio C HamanoDec 5, 2005
  8. Johannes SchindelinDec 5, 2005

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.