{"thread":{"id":"19256","subject":"[PATCH] config: add --repository option","startedAt":"2009-05-09T16:35:36Z","lastAt":"2009-06-02T16:38:59Z","messageCount":4,"participants":["Sverre Rabbelier","Nanako Shiraishi","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"113414","messageId":"1241886936-18941-1-git-send-email-srabbelier@gmail.com","threadId":"19256","inReplyTo":null,"subject":"[PATCH] config: add --repository option","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-05-09T16:35:36Z","receivedAt":"2009-05-09T16:35:36Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"This is a shorthand similar to --system but instead uses\nthe config file of the current repository.\n\nSigned-off-by: Sverre Rabbelier <srabbelier@gmail.com>\n---\n\n\tI often want to check what the local value of a config\n\tentry is, hence this patch.\n\n builtin-config.c |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-config.c b/builtin-config.c\nindex a81bc8b..1ae4f82 100644\n--- a/builtin-config.c\n+++ b/builtin-config.c\n@@ -20,7 +20,7 @@ static char delim = '=';\n static char key_delim = ' ';\n static char term = '\\n';\n \n-static int use_global_config, use_system_config;\n+static int use_global_config, use_system_config, use_repository_config;\n static const char *given_config_file;\n static int actions, types;\n static const char *get_color_slot, *get_colorbool_slot;\n@@ -50,6 +50,7 @@ static struct option builtin_config_options[] = {\n \tOPT_GROUP(\"Config file location\"),\n \tOPT_BOOLEAN(0, \"global\", &use_global_config, \"use global config file\"),\n \tOPT_BOOLEAN(0, \"system\", &use_system_config, \"use system config file\"),\n+\tOPT_BOOLEAN(0, \"repository\", &use_repository_config, \"use repository config file\"),\n \tOPT_STRING('f', \"file\", &given_config_file, \"FILE\", \"use given config file\"),\n \tOPT_GROUP(\"Action\"),\n \tOPT_BIT(0, \"get\", &actions, \"get value: name [value-regex]\", ACTION_GET),\n@@ -319,7 +320,7 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)\n \targc = parse_options(argc, argv, builtin_config_options, builtin_config_usage,\n \t\t\t     PARSE_OPT_STOP_AT_NON_OPTION);\n \n-\tif (use_global_config + use_system_config + !!given_config_file > 1) {\n+\tif (use_global_config + use_system_config + use_repository_config + !!given_config_file > 1) {\n \t\terror(\"only one config file at a time.\");\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n@@ -335,6 +336,8 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)\n \t}\n \telse if (use_system_config)\n \t\tconfig_exclusive_filename = git_etc_gitconfig();\n+\telse if (use_repository_config)\n+\t\tconfig_exclusive_filename = git_pathdup(\"config\");\n \telse if (given_config_file) {\n \t\tif (!is_absolute_path(given_config_file) && prefix)\n \t\t\tconfig_exclusive_filename = prefix_filename(prefix,\n-- \n1.6.3.1.ga0e91\n"},{"id":"115235","messageId":"20090602195555.6117@nanako3.lavabit.com","threadId":"19256","inReplyTo":"1241886936-18941-1-git-send-email-srabbelier@gmail.com","subject":"Re: [PATCH] config: add --repository option","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-06-02T10:55:55Z","receivedAt":"2009-06-02T10:55:55Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Sverre Rabbelier <srabbelier@gmail.com>:\n\n> This is a shorthand similar to --system but instead uses\n> the config file of the current repository.\n>\n> Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>\n> ---\n>\n> \tI often want to check what the local value of a config\n> \tentry is, hence this patch.\n>\n>  builtin-config.c |    7 +++++--\n>  1 files changed, 5 insertions(+), 2 deletions(-)\n\nJunio, may I ask what happened to this patch?\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"115254","messageId":"7vskiifyd5.fsf@alter.siamese.dyndns.org","threadId":"19256","inReplyTo":"20090602195555.6117@nanako3.lavabit.com","subject":"Re: [PATCH] config: add --repository option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-02T15:29:10Z","receivedAt":"2009-06-02T15:29:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> Quoting Sverre Rabbelier <srabbelier@gmail.com>:\n>\n>> This is a shorthand similar to --system but instead uses\n>> the config file of the current repository.\n>>\n>> Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>\n>> ---\n>>\n>> \tI often want to check what the local value of a config\n>> \tentry is, hence this patch.\n>>\n>>  builtin-config.c |    7 +++++--\n>>  1 files changed, 5 insertions(+), 2 deletions(-)\n>\n> Junio, may I ask what happened to this patch?\n\nNothing ;-)\n\nI did see it, but simply forgot about it, as nobody else seemed to be\ninterested nor found anything objectionable in it.\n\nI somehow think --repository is much harder to type than --local, and in\nthe context of the command, somehow --local would mesh better with other\nexisting options --system and --global, but that comment falls into the\nbikeshedding category.\n"},{"id":"115260","messageId":"fabb9a1e0906020938h73a49ecbr5a7c78e30c8ec6d7@mail.gmail.com","threadId":"19256","inReplyTo":"7vskiifyd5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] config: add --repository option","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-06-02T16:38:59Z","receivedAt":"2009-06-02T16:38:59Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Tue, Jun 2, 2009 at 17:29, Junio C Hamano <gitster@pobox.com> wrote:\n> I somehow think --repository is much harder to type than --local, and in\n> the context of the command, somehow --local would mesh better with other\n> existing options --system and --global, but that comment falls into the\n> bikeshedding category.\n\nHa! I had --local at first, but then figured that might be confusing\nsince 'local' usually refers to 'on my machine', rather than 'in this\nrepository'. I'm fine with either.\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}