{"thread":{"id":"2675","subject":"[PATCH] config.c: remove unnecessary header in minimum configuration file.","startedAt":"2005-11-25T22:22:27Z","lastAt":"2005-12-05T22:16:45Z","messageCount":8,"participants":["Junio C Hamano","Andreas Ericsson","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"12743","messageId":"7v7jawmkpo.fsf@assigned-by-dhcp.cox.net","threadId":"2675","inReplyTo":null,"subject":"[PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-25T22:22:27Z","receivedAt":"2005-11-25T22:22:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"It is just silly to start the file called \"config\" with a\ncomment that says \"This is the config file.\"\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n config.c               |    8 --------\n t/t1300-repo-config.sh |   20 --------------------\n 2 files changed, 0 insertions(+), 28 deletions(-)\n\napplies-to: f316bfd81eaa2064c1d9e01a336eaed8d7a5bd4f\n55c2454c6f18323b5ff04504593603848084aa4d\ndiff --git a/config.c b/config.c\nindex 5cc8535..52659f9 100644\n--- a/config.c\n+++ b/config.c\n@@ -445,12 +445,6 @@ int git_config_set_multivar(const char* \n \t * If .git/config does not exist yet, write a minimal version.\n \t */\n \tif (stat(config_filename, &st)) {\n-\t\tstatic const char contents[] =\n-\t\t\t\"#\\n\"\n-\t\t\t\"# This is the config file\\n\"\n-\t\t\t\"#\\n\"\n-\t\t\t\"\\n\";\n-\n \t\tfree(store.key);\n \n \t\t/* if nothing to unset, error out */\n@@ -461,8 +455,6 @@ int git_config_set_multivar(const char* \n \t\t}\n \n \t\tstore.key = (char*)key;\n-\n-\t\twrite(fd, contents, sizeof(contents)-1);\n \t\tstore_write_section(fd, key);\n \t\tstore_write_pair(fd, key, value);\n \t} else{\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 5e994ff..207dd3d 100644\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -12,10 +12,6 @@ test -f .git/config && rm .git/config\n git-repo-config core.penguin \"little blue\"\n \n cat > expect << EOF\n-#\n-# This is the config file\n-#\n-\n [core]\n \tpenguin = little blue\n EOF\n@@ -25,10 +21,6 @@ test_expect_success 'initial' 'cmp .git/\n git-repo-config Core.Movie BadPhysics\n \n cat > expect << EOF\n-#\n-# This is the config file\n-#\n-\n [core]\n \tpenguin = little blue\n \tMovie = BadPhysics\n@@ -39,10 +31,6 @@ test_expect_success 'mixed case' 'cmp .g\n git-repo-config Cores.WhatEver Second\n \n cat > expect << EOF\n-#\n-# This is the config file\n-#\n-\n [core]\n \tpenguin = little blue\n \tMovie = BadPhysics\n@@ -55,10 +43,6 @@ test_expect_success 'similar section' 'c\n git-repo-config CORE.UPPERCASE true\n \n cat > expect << EOF\n-#\n-# This is the config file\n-#\n-\n [core]\n \tpenguin = little blue\n \tMovie = BadPhysics\n@@ -76,10 +60,6 @@ test_expect_success 'replace with non-ma\n \t'git-repo-config core.penguin \"very blue\" !kingpin'\n \n cat > expect << EOF\n-#\n-# This is the config file\n-#\n-\n [core]\n \tpenguin = very blue\n \tMovie = BadPhysics\n---\n0.99.9.GIT\n"},{"id":"13194","messageId":"7vu0docrqz.fsf@assigned-by-dhcp.cox.net","threadId":"2675","inReplyTo":"7v7jawmkpo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T00:27:48Z","receivedAt":"2005-12-05T00:27:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> It is just silly to start the file called \"config\" with a\n> comment that says \"This is the config file.\"\n\nAny likes or dislikes?\n"},{"id":"13200","messageId":"4394255D.1030009@op5.se","threadId":"2675","inReplyTo":"7vu0docrqz.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-12-05T11:32:45Z","receivedAt":"2005-12-05T11:32:45Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Junio C Hamano <junkio@cox.net> writes:\n> \n> \n>>It is just silly to start the file called \"config\" with a\n>>comment that says \"This is the config file.\"\n> \n> \n> Any likes or dislikes?\n> \n\nI believe we all agree in silent consensus.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"13214","messageId":"Pine.LNX.4.63.0512052124400.4026@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2675","inReplyTo":"4394255D.1030009@op5.se","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-12-05T20:25:45Z","receivedAt":"2005-12-05T20:25:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 5 Dec 2005, Andreas Ericsson wrote:\n\n> Junio C Hamano wrote:\n> > Junio C Hamano <junkio@cox.net> writes:\n> > \n> > \n> > > It is just silly to start the file called \"config\" with a\n> > > comment that says \"This is the config file.\"\n> > \n> > \n> > Any likes or dislikes?\n> > \n> \n> I believe we all agree in silent consensus.\n\nI don't really care, since I know very well that it is a config file... \nHowever, you should also remove the header which is generated in init-db.c \nwhen it is determined that the file system does not respect the executable \nflag.\n\nCiao,\nDscho\n"},{"id":"13219","messageId":"7vek4rb6vc.fsf@assigned-by-dhcp.cox.net","threadId":"2675","inReplyTo":"Pine.LNX.4.63.0512052124400.4026@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T20:56:23Z","receivedAt":"2005-12-05T20:56:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> However, you should also remove the header which is generated in init-db.c \n> when it is determined that the file system does not respect the executable \n> flag.\n\nI suspect that code is not there anymore.\n"},{"id":"13221","messageId":"Pine.LNX.4.63.0512052202300.12016@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2675","inReplyTo":"7vek4rb6vc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-12-05T21:05:59Z","receivedAt":"2005-12-05T21:05:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 5 Dec 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > However, you should also remove the header which is generated in init-db.c \n> > when it is determined that the file system does not respect the executable \n> > flag.\n> \n> I suspect that code is not there anymore.\n\nOops. I missed that one (probably because it did not say anything about \nthe filemode test in the shortlog).\n\nHowever, reading the code I am not satisfied. If there is no template for \nthe config file, it does not test the filemode at all.\n\nIn fact, it reverses my design: I did *not* touch an existing config file, \nbut only created one if none existed. And if the filemode was not set, I \nthrew the config file away.\n\nCiao,\nDscho\n"},{"id":"13226","messageId":"7vzmnf9px8.fsf@assigned-by-dhcp.cox.net","threadId":"2675","inReplyTo":"Pine.LNX.4.63.0512052202300.12016@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T21:47:47Z","receivedAt":"2005-12-05T21:47:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> However, reading the code I am not satisfied. If there is no template for \n> the config file, it does not test the filemode at all.\n\nI have a feeling that you have not tried the code you are\narguing against.\n\nIt always creates the config file because it needs to record the\nrepository format version (among other things), so the config\nfile exists even if you do not have templates.  Even if you do\nnot have a valid template directory that is supposed to work,\nbut obviously you have not tried it ;-).\n\nNow, it is arguable that the current format version being 0, and\nnot having the format version is equivalent to having 0 as the\nformat version, it is not necessary to create an empty\nconfiguration file at this moment, but by making sure we record\nthe format version the tool that created the repository supports\nnow in the version 0, we do not have to risk forgetting to add\nthat logic later when we _do_ need to write something non-zero.\n"},{"id":"13231","messageId":"Pine.LNX.4.63.0512052316150.3284@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2675","inReplyTo":"7vzmnf9px8.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] config.c: remove unnecessary header in minimum configuration file.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-12-05T22:16:45Z","receivedAt":"2005-12-05T22:16:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 5 Dec 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > However, reading the code I am not satisfied. If there is no template for \n> > the config file, it does not test the filemode at all.\n> \n> I have a feeling that you have not tried the code you are\n> arguing against.\n\nGot me right there.\n\nSorry.\n\nCiao,\nDscho\n"}]}