{"thread":{"id":"9325","subject":"[PATCH] Add an option to specify a file to config builtin","startedAt":"2007-07-31T11:53:04Z","lastAt":"2007-07-31T22:36:13Z","messageCount":5,"participants":["Alex Riesen","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49210","messageId":"81b0412b0707310453pc6b11d2r90ca0f22b5ed601e@mail.gmail.com","threadId":"9325","inReplyTo":null,"subject":"[PATCH] Add an option to specify a file to config builtin","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-31T11:53:04Z","receivedAt":"2007-07-31T11:53:04Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"There are (really!) systems where using environment variables is very\ncumbersome (yes, Windows, it has problems unsetting them). Besides this\nform is shorter.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n Documentation/git-config.txt |   29 ++++++++++++++++-------------\n builtin-config.c             |    9 ++++++++-\n 2 files changed, 24 insertions(+), 14 deletions(-)\n\n\nFrom 787abe4b0a71856b8671a41c9b83561fde84e558 Mon Sep 17 00:00:00 2001\nFrom: Alex Riesen <raa.lkml@gmail.com>\nDate: Tue, 31 Jul 2007 11:58:43 +0200\nSubject: [PATCH] Add an option to specify a file to config builtin\n\nThere are (really!) systems where using environment variables is very\ncumbersome (yes, Windows, it has problems unsetting them). Besides this\nform is shorter.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n Documentation/git-config.txt |   29 ++++++++++++++++-------------\n builtin-config.c             |    9 ++++++++-\n 2 files changed, 24 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\nindex 5f66a7f..88acf6c 100644\n--- a/Documentation/git-config.txt\n+++ b/Documentation/git-config.txt\n@@ -9,17 +9,17 @@ git-config - Get and set repository or global options\n SYNOPSIS\n --------\n [verse]\n-'git-config' [--system | --global] [type] [-z|--null] name [value [value_regex]]\n-'git-config' [--system | --global] [type] --add name value\n-'git-config' [--system | --global] [type] --replace-all name [value [value_regex]]\n-'git-config' [--system | --global] [type] [-z|--null] --get name [value_regex]\n-'git-config' [--system | --global] [type] [-z|--null] --get-all name [value_regex]\n-'git-config' [--system | --global] [type] [-z|--null] --get-regexp name_regex [value_regex]\n-'git-config' [--system | --global] --unset name [value_regex]\n-'git-config' [--system | --global] --unset-all name [value_regex]\n-'git-config' [--system | --global] --rename-section old_name new_name\n-'git-config' [--system | --global] --remove-section name\n-'git-config' [--system | --global] [-z|--null] -l | --list\n+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] name [value [value_regex]]\n+'git-config' [--system | --global | [-f|--file] config-file] [type] --add name value\n+'git-config' [--system | --global | [-f|--file] config-file] [type] --replace-all name [value [value_regex]]\n+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get name [value_regex]\n+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get-all name [value_regex]\n+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get-regexp name_regex [value_regex]\n+'git-config' [--system | --global | [-f|--file] config-file] --unset name [value_regex]\n+'git-config' [--system | --global | [-f|--file] config-file] --unset-all name [value_regex]\n+'git-config' [--system | --global | [-f|--file] config-file] --rename-section old_name new_name\n+'git-config' [--system | --global | [-f|--file] config-file] --remove-section name\n+'git-config' [--system | --global | [-f|--file] config-file] [-z|--null] -l | --list\n \n DESCRIPTION\n -----------\n@@ -42,8 +42,8 @@ no checks or transformations are performed on the value.\n \n This command will fail if:\n \n-. The .git/config file is invalid,\n-. Can not write to .git/config,\n+. The config file is invalid,\n+. Can not write to the config file,\n . no section was provided,\n . the section or key is invalid,\n . you try to unset an option which does not exist,\n@@ -93,6 +93,9 @@ rather than from all available files.\n +\n See also <<FILES>>.\n \n+-f config-file, --file config-file::\n+\tUse the given config file instead of the one specified by GIT_CONFIG.\n+\n --remove-section::\n \tRemove the given section from the configuration file.\n \ndiff --git a/builtin-config.c b/builtin-config.c\nindex 7d2063c..0a605e0 100644\n--- a/builtin-config.c\n+++ b/builtin-config.c\n@@ -2,7 +2,7 @@\n #include \"cache.h\"\n \n static const char git_config_set_usage[] =\n-\"git-config [ --global | --system ] [ --bool | --int ] [ -z | --null ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list\";\n+\"git-config [ --global | --system | [ -f | --file ] config-file ] [ --bool | --int ] [ -z | --null ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list\";\n \n static char *key;\n static regex_t *key_regexp;\n@@ -186,6 +186,13 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t}\n \t\telse if (!strcmp(argv[1], \"--system\"))\n \t\t\tsetenv(CONFIG_ENVIRONMENT, ETC_GITCONFIG, 1);\n+\t\telse if (!strcmp(argv[1], \"--file\") || !strcmp(argv[1], \"-f\")) {\n+\t\t\tif (argc < 3)\n+\t\t\t\tusage(git_config_set_usage);\n+\t\t\tsetenv(CONFIG_ENVIRONMENT, argv[2], 1);\n+\t\t\targc--;\n+\t\t\targv++;\n+\t\t}\n \t\telse if (!strcmp(argv[1], \"--null\") || !strcmp(argv[1], \"-z\")) {\n \t\t\tterm = '\\0';\n \t\t\tdelim = '\\n';\n-- \n1.5.3.rc3.132.g39179\n\n"},{"id":"49212","messageId":"Pine.LNX.4.64.0707311258340.14781@racer.site","threadId":"9325","inReplyTo":"81b0412b0707310453pc6b11d2r90ca0f22b5ed601e@mail.gmail.com","subject":"Re: [PATCH] Add an option to specify a file to config builtin","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-31T11:59:17Z","receivedAt":"2007-07-31T11:59:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 31 Jul 2007, Alex Riesen wrote:\n\n> There are (really!) systems where using environment variables is very\n> cumbersome (yes, Windows, it has problems unsetting them). Besides this\n> form is shorter.\n\nYou could use this chance to make the verse nicer, i.e. split it into a \n[<file-option>] and an [<action>] part.\n\nCiao,\nDscho\n"},{"id":"49213","messageId":"81b0412b0707310502x588c9c6dh7d9290360b27647a@mail.gmail.com","threadId":"9325","inReplyTo":"Pine.LNX.4.64.0707311258340.14781@racer.site","subject":"Re: [PATCH] Add an option to specify a file to config builtin","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-31T12:02:13Z","receivedAt":"2007-07-31T12:02:13Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/31/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> > There are (really!) systems where using environment variables is very\n> > cumbersome (yes, Windows, it has problems unsetting them). Besides this\n> > form is shorter.\n>\n> You could use this chance to make the verse nicer, i.e. split it into a\n> [<file-option>] and an [<action>] part.\n\nMissed that opportunity for today, I'm afraid. Will try to get to it\nthe next evening\n"},{"id":"49248","messageId":"20070731220117.GA3196@steel.home","threadId":"9325","inReplyTo":"81b0412b0707310502x588c9c6dh7d9290360b27647a@mail.gmail.com","subject":"[PATCH] Make verse of git-config manpage more readable","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-31T22:01:17Z","receivedAt":"2007-07-31T22:01:17Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Also mention '--file' in FILES.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n\nAlex Riesen, Tue, Jul 31, 2007 14:02:13 +0200:\n> On 7/31/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > You could use this chance to make the verse nicer, i.e. split it into a\n> > [<file-option>] and an [<action>] part.\n\nDid only the long one, file-option. I don't think the [<action>] part\nis essential, though. It is quite understandable...\n\n Documentation/git-config.txt |   32 +++++++++++++++++++-------------\n 1 files changed, 19 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\nindex 88acf6c..8451ccc 100644\n--- a/Documentation/git-config.txt\n+++ b/Documentation/git-config.txt\n@@ -9,17 +9,17 @@ git-config - Get and set repository or global options\n SYNOPSIS\n --------\n [verse]\n-'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] name [value [value_regex]]\n-'git-config' [--system | --global | [-f|--file] config-file] [type] --add name value\n-'git-config' [--system | --global | [-f|--file] config-file] [type] --replace-all name [value [value_regex]]\n-'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get name [value_regex]\n-'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get-all name [value_regex]\n-'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get-regexp name_regex [value_regex]\n-'git-config' [--system | --global | [-f|--file] config-file] --unset name [value_regex]\n-'git-config' [--system | --global | [-f|--file] config-file] --unset-all name [value_regex]\n-'git-config' [--system | --global | [-f|--file] config-file] --rename-section old_name new_name\n-'git-config' [--system | --global | [-f|--file] config-file] --remove-section name\n-'git-config' [--system | --global | [-f|--file] config-file] [-z|--null] -l | --list\n+'git-config' [<file-option>] [type] [-z|--null] name [value [value_regex]]\n+'git-config' [<file-option>] [type] --add name value\n+'git-config' [<file-option>] [type] --replace-all name [value [value_regex]]\n+'git-config' [<file-option>] [type] [-z|--null] --get name [value_regex]\n+'git-config' [<file-option>] [type] [-z|--null] --get-all name [value_regex]\n+'git-config' [<file-option>] [type] [-z|--null] --get-regexp name_regex [value_regex]\n+'git-config' [<file-option>] --unset name [value_regex]\n+'git-config' [<file-option>] --unset-all name [value_regex]\n+'git-config' [<file-option>] --rename-section old_name new_name\n+'git-config' [<file-option>] --remove-section name\n+'git-config' [<file-option>] [-z|--null] -l | --list\n \n DESCRIPTION\n -----------\n@@ -40,6 +40,12 @@ convert the value to the canonical form (simple decimal number for int,\n a \"true\" or \"false\" string for bool).  If no type specifier is passed,\n no checks or transformations are performed on the value.\n \n+The file-option can be one of '--system', '--global' or '--file'\n+which specify where the values will be read from or written to.\n+The default is to assume the config file of the current repository,\n+.git/config unless defined otherwise with GIT_DIR and GIT_CONFIG\n+(see <<FILES>>).\n+\n This command will fail if:\n \n . The config file is invalid,\n@@ -133,8 +139,8 @@ See also <<FILES>>.\n FILES\n -----\n \n-There are three files where git-config will search for configuration\n-options:\n+If not set explicitely with '--file', there are three files where\n+git-config will search for configuration options:\n \n .git/config::\n \tRepository specific configuration file. (The filename is\n-- \n1.5.3.rc3.116.g94fd8\n"},{"id":"49250","messageId":"Pine.LNX.4.64.0707312335200.14781@racer.site","threadId":"9325","inReplyTo":"20070731220117.GA3196@steel.home","subject":"Re: [PATCH] Make verse of git-config manpage more readable","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-31T22:36:13Z","receivedAt":"2007-07-31T22:36:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 1 Aug 2007, Alex Riesen wrote:\n\n> Also mention '--file' in FILES.\n> \n> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>\n> ---\n> \n> Alex Riesen, Tue, Jul 31, 2007 14:02:13 +0200:\n> > On 7/31/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > > You could use this chance to make the verse nicer, i.e. split it into a\n> > > [<file-option>] and an [<action>] part.\n> \n> Did only the long one, file-option. I don't think the [<action>] part\n> is essential, though. It is quite understandable...\n\nIt is too long.  That's my gripe with it.  But then, I do not really care; \nI know pretty well what \"git config\" can do...\n\nCiao,\nDscho\n"}]}