{"thread":{"id":"19252","subject":"[PATCHv2 0/2] completion: config --unset/get","startedAt":"2009-05-09T01:23:31Z","lastAt":"2009-05-13T18:50:39Z","messageCount":9,"participants":["Stephen Boyd","Shawn O. Pearce","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"113384","messageId":"1241832213-23070-1-git-send-email-bebarino@gmail.com","threadId":"19252","inReplyTo":null,"subject":"[PATCHv2 0/2] completion: config --unset/get","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-09T01:23:31Z","receivedAt":"2009-05-09T01:23:31Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Changes since version 1:\n    - Simplified into one function\n    - Config file search done in reverse\n    - No longer messes up your config file\n\nStephen Boyd (2):\n  completion: add __git_config_get_set_variables() to get config\n    variables\n  completion: complete config variables for\n    --get/getall/unset/unset-all\n\n contrib/completion/git-completion.bash |   33 ++++++++++++++++++++++++++++++++\n 1 files changed, 33 insertions(+), 0 deletions(-)\n"},{"id":"113386","messageId":"1241832213-23070-2-git-send-email-bebarino@gmail.com","threadId":"19252","inReplyTo":"1241832213-23070-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 1/2] completion: add __git_config_get_set_variables() to get config variables","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-09T01:23:32Z","receivedAt":"2009-05-09T01:23:32Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"This function retrieves the set configuration variables from the\nappropriate configuration file. For example, if the user has previously\nspecified --global only the global variables are returned. The same\napplies for --system, and --file. If no location has been specified, all\nset variables are returned.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n contrib/completion/git-completion.bash |   29 +++++++++++++++++++++++++++++\n 1 files changed, 29 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1683e6d..e73359c 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1322,6 +1322,35 @@ _git_send_email ()\n \tCOMPREPLY=()\n }\n \n+__git_config_get_set_variables ()\n+{\n+\tlocal prevword word config_file= c=$COMP_CWORD\n+\twhile [ $c -gt 1 ]; do\n+\t\tword=\"${COMP_WORDS[c]}\"\n+\t\tcase \"$word\" in\n+\t\t--global|--system|--file=*)\n+\t\t\tconfig_file=\"$word\"\n+\t\t\tbreak\n+\t\t\t;;\n+\t\t-f|--file)\n+\t\t\tconfig_file=\"$word $prevword\"\n+\t\t\tbreak\n+\t\t\t;;\n+\t\tesac\n+\t\tprevword=$word\n+\t\tc=$((--c))\n+\tdone\n+\n+\tfor i in $(git --git-dir=\"$(__gitdir)\" config $config_file --list \\\n+\t\t\t2>/dev/null); do\n+\t\tcase \"$i\" in\n+\t\t*.*)\n+\t\t\techo \"${i/=*/}\"\n+\t\t\t;;\n+\t\tesac\n+\tdone\n+}\n+\n _git_config ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-- \n1.6.3\n"},{"id":"113385","messageId":"1241832213-23070-3-git-send-email-bebarino@gmail.com","threadId":"19252","inReplyTo":"1241832213-23070-2-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-09T01:23:33Z","receivedAt":"2009-05-09T01:23:33Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"This should make it easier for users to get and unset their\nconfiguration variables without having to open documentation or dig\nthrough their configuration file.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n contrib/completion/git-completion.bash |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex e73359c..ad26b7c 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1417,6 +1417,10 @@ _git_config ()\n \t\t__gitcomp \"$__git_send_email_suppresscc_options\"\n \t\treturn\n \t\t;;\n+\t--get|--get-all|--unset|--unset-all)\n+\t\t__gitcomp \"$(__git_config_get_set_variables)\"\n+\t\treturn\n+\t\t;;\n \t*.*)\n \t\tCOMPREPLY=()\n \t\treturn\n-- \n1.6.3\n"},{"id":"113388","messageId":"20090509034438.GZ30527@spearce.org","threadId":"19252","inReplyTo":"1241832213-23070-3-git-send-email-bebarino@gmail.com","subject":"Re: [PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-09T03:44:38Z","receivedAt":"2009-05-09T03:44:38Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> wrote:\n> This should make it easier for users to get and unset their\n> configuration variables without having to open documentation or dig\n> through their configuration file.\n> \n> Signed-off-by: Stephen Boyd <bebarino@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |    4 ++++\n>  1 files changed, 4 insertions(+), 0 deletions(-)\n\nThese probably could have been one patch, since the function\nis introduced only to support this one usage, and this patch\nis only 4 lines larger than the function definition anyway...\n\nBut yea, this series is better.\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index e73359c..ad26b7c 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1417,6 +1417,10 @@ _git_config ()\n>  \t\t__gitcomp \"$__git_send_email_suppresscc_options\"\n>  \t\treturn\n>  \t\t;;\n> +\t--get|--get-all|--unset|--unset-all)\n> +\t\t__gitcomp \"$(__git_config_get_set_variables)\"\n> +\t\treturn\n> +\t\t;;\n>  \t*.*)\n>  \t\tCOMPREPLY=()\n>  \t\treturn\n> -- \n> 1.6.3\n> \n\n-- \nShawn.\n"},{"id":"113611","messageId":"4A09071A.1030107@gmail.com","threadId":"19252","inReplyTo":"20090509034438.GZ30527@spearce.org","subject":"Re: [PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-12T05:20:26Z","receivedAt":"2009-05-12T05:20:26Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Shawn O. Pearce wrote:\n> These probably could have been one patch, since the function\n> is introduced only to support this one usage, and this patch\n> is only 4 lines larger than the function definition anyway...\n\nSeeing that this hasn't been picked up yet, I'm fine with this being\nsquashed into one commit. Could you use this combination of the two\nmessages for the commit?\n\n---8<----\n\nSubject: completion: complete config variables for\n--get/getall/unset/unset-all\n\nThis should make it easier for users to get and unset their\nconfiguration variables without having to open documentation or dig\nthrough their configuration file.\n\n__git_config_get_set_variables() retrieves the set configuration variables\n from the appropriate configuration file. For example, if the user has\npreviously specified --global only the global variables are returned. The\nsame applies for --system, and --file. If no location has been\nspecified, all\nset variables are returned.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n"},{"id":"113620","messageId":"7vtz3q91up.fsf@alter.siamese.dyndns.org","threadId":"19252","inReplyTo":"4A09071A.1030107@gmail.com","subject":"Re: [PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-12T08:12:14Z","receivedAt":"2009-05-12T08:12:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> Shawn O. Pearce wrote:\n>> These probably could have been one patch, since the function\n>> is introduced only to support this one usage, and this patch\n>> is only 4 lines larger than the function definition anyway...\n>\n> Seeing that this hasn't been picked up yet, I'm fine with this being\n> squashed into one commit. Could you use this combination of the two\n> messages for the commit?\n>\n> ---8<----\n>\n> Subject: completion: complete config variables for\n> --get/getall/unset/unset-all\n\nHmm, shouldn't this just be\n\n    Subject: completion: complete variable names for \"git config\" command\n\n?\n"},{"id":"113684","messageId":"780e0a6b0905121205r7a57a99as2cb0b94ead73199d@mail.gmail.com","threadId":"19252","inReplyTo":"7vtz3q91up.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-12T19:05:05Z","receivedAt":"2009-05-12T19:05:05Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Tue, May 12, 2009 at 1:12 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stephen Boyd <bebarino@gmail.com> writes:\n>\n>> Shawn O. Pearce wrote:\n>>> These probably could have been one patch, since the function\n>>> is introduced only to support this one usage, and this patch\n>>> is only 4 lines larger than the function definition anyway...\n>>\n>> Seeing that this hasn't been picked up yet, I'm fine with this being\n>> squashed into one commit. Could you use this combination of the two\n>> messages for the commit?\n>>\n>> ---8<----\n>>\n>> Subject: completion: complete config variables for\n>> --get/getall/unset/unset-all\n>\n> Hmm, shouldn't this just be\n>\n>    Subject: completion: complete variable names for \"git config\" command\n>\n> ?\n>\n\nThis patch adds completion for set variable names when --get,\n--get-all, --set, or --set-all has been specified. Completion of\nvariable names for git config already exists. Maybe this would be more\nclear:\n\nSubject: completion: complete set variable names for git config\n--get/get-all/set-set-all\n"},{"id":"113822","messageId":"7vtz3o4zu2.fsf@alter.siamese.dyndns.org","threadId":"19252","inReplyTo":"780e0a6b0905121205r7a57a99as2cb0b94ead73199d@mail.gmail.com","subject":"Re: [PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-13T18:33:57Z","receivedAt":"2009-05-13T18:33:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n>>> Subject: completion: complete config variables for\n>>> --get/getall/unset/unset-all\n>>\n>> Hmm, shouldn't this just be\n>>\n>>    Subject: completion: complete variable names for \"git config\" command\n>>\n>> ?\n>>\n>\n> This patch adds completion for set variable names when --get,\n> --get-all, --set, or --set-all has been specified. Completion of\n> variable names for git config already exists. Maybe this would be more\n> clear:\n>\n> Subject: completion: complete set variable names for git config\n> --get/get-all/set-set-all\n\nActually I was shooting for shorter description.  It is more like\n\n\tbash: complete variable names for \"git config\" with options\n\nperhaps?\n"},{"id":"113826","messageId":"780e0a6b0905131150q30e0bcacrff69cd78cd96ff34@mail.gmail.com","threadId":"19252","inReplyTo":"7vtz3o4zu2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv2 2/2] completion: complete config variables for --get/getall/unset/unset-all","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-13T18:50:39Z","receivedAt":"2009-05-13T18:50:39Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Wed, May 13, 2009 at 11:33 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stephen Boyd <bebarino@gmail.com> writes:\n>\n>>>> Subject: completion: complete config variables for\n>>>> --get/getall/unset/unset-all\n>>>\n>>> Hmm, shouldn't this just be\n>>>\n>>>    Subject: completion: complete variable names for \"git config\" command\n>>>\n>>> ?\n>>>\n>>\n>> This patch adds completion for set variable names when --get,\n>> --get-all, --set, or --set-all has been specified. Completion of\n>> variable names for git config already exists. Maybe this would be more\n>> clear:\n>>\n>> Subject: completion: complete set variable names for git config\n>> --get/get-all/set-set-all\n>\n> Actually I was shooting for shorter description.  It is more like\n>\n>        bash: complete variable names for \"git config\" with options\n>\n> perhaps?\n>\n>\n\nHeh, ok. This sounds fine.\n"}]}