{"thread":{"id":"32869","subject":"git-completion.bash --local","startedAt":"2013-02-09T18:37:28Z","lastAt":"2013-02-13T07:44:34Z","messageCount":9,"participants":["Dasa Paddock","Jeff King","Matthieu Moy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"209086","messageId":"85E0E68E8961D64E9200C534AC5E1B240A443EDC@RED-INF-EXMB-P1.esri.com","threadId":"32869","inReplyTo":null,"subject":"git-completion.bash --local","fromName":"Dasa Paddock","fromEmail":"dpaddock@esri.com","sentAt":"2013-02-09T18:37:28Z","receivedAt":"2013-02-09T18:37:28Z","isPatch":false,"sender":{"key":"dpaddock@esri.com","avatar":null},"body":"I think this line should include --local:\n\nhttps://github.com/git/git/blob/next/contrib/completion/git-completion.bash#L1782\n    \"--global|--system|--file=*)\"\n\nThis would help for:\n    git config -l --local\n\nThanks,\nDasa Paddock"},{"id":"209303","messageId":"20130211210455.GB32740@sigill.intra.peff.net","threadId":"32869","inReplyTo":"85E0E68E8961D64E9200C534AC5E1B240A443EDC@RED-INF-EXMB-P1.esri.com","subject":"Re: git-completion.bash --local","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-02-11T21:04:55Z","receivedAt":"2013-02-11T21:04:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Feb 09, 2013 at 06:37:28PM +0000, Dasa Paddock wrote:\n\n> I think this line should include --local:\n> \n> https://github.com/git/git/blob/next/contrib/completion/git-completion.bash#L1782\n>     \"--global|--system|--file=*)\"\n\nYeah, I think that makes sense.\n\nCare to prepare a patch?\n\n-Peff\n"},{"id":"209334","messageId":"20130212054922.GA20129@sigill.intra.peff.net","threadId":"32869","inReplyTo":"20130211210455.GB32740@sigill.intra.peff.net","subject":"[PATCH] completion: recognize \"--local\" as a config file source","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-02-12T05:49:22Z","receivedAt":"2013-02-12T05:49:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When we are trying to show the list of config variables in a\nfile, we recognize \"--system\", \"--global\", and \"--file\" as\nspecifying a particular file. This list misses \"--local\",\nwhich performs a similar function.\n\nWithout this patch, completing:\n\n  git config --get --local\n\nshows items from all config files, not just the local one.\n\nNoticed-by: Dasa Paddock <dpaddock@esri.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n contrib/completion/git-completion.bash | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex c8452fb..0b7b659 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1779,7 +1779,7 @@ __git_config_get_set_variables ()\n \twhile [ $c -gt 1 ]; do\n \t\tword=\"${words[c]}\"\n \t\tcase \"$word\" in\n-\t\t--global|--system|--file=*)\n+\t\t--global|--system|--local|--file=*)\n \t\t\tconfig_file=\"$word\"\n \t\t\tbreak\n \t\t\t;;\n-- \n1.8.1.2.11.g1a2f572\n"},{"id":"209364","messageId":"1360671642-10272-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"32869","inReplyTo":"85E0E68E8961D64E9200C534AC5E1B240A443EDC@RED-INF-EXMB-P1.esri.com","subject":"[PATCH] completion: support 'git config --local'","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-02-12T12:20:42Z","receivedAt":"2013-02-12T12:20:42Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"This needs to be done in two places: __git_config_get_set_variables to\nallow clever completion of \"git config --local --get foo<tab>\", and\n_git_config to allow \"git config --loc<tab>\" to complete to --local.\n\nWhile we're there, change the order of options in the code to match\ngit-config.txt.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n> I think this line should include --local:\n> \n> https://github.com/git/git/blob/next/contrib/completion/git-completion.bash#L1782\n>     \"--global|--system|--file=*)\"\n> \n> This would help for:\n>     git config -l --local\n\nYes, but not only ;-)\n\n contrib/completion/git-completion.bash | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 5770b6f..2e1ad67 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1570,7 +1570,7 @@ __git_config_get_set_variables ()\n \twhile [ $c -gt 1 ]; do\n \t\tword=\"${words[c]}\"\n \t\tcase \"$word\" in\n-\t\t--global|--system|--file=*)\n+\t\t--system|--global|--local|--file=*)\n \t\t\tconfig_file=\"$word\"\n \t\t\tbreak\n \t\t\t;;\n@@ -1676,7 +1676,7 @@ _git_config ()\n \tcase \"$cur\" in\n \t--*)\n \t\t__gitcomp \"\n-\t\t\t--global --system --file=\n+\t\t\t--system --global --local --file=\n \t\t\t--list --replace-all\n \t\t\t--get --get-all --get-regexp\n \t\t\t--add --unset --unset-all\n-- \n1.8.1.2.548.g956380a.dirty\n"},{"id":"209379","messageId":"7vzjz9h1w0.fsf@alter.siamese.dyndns.org","threadId":"32869","inReplyTo":"1360671642-10272-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] completion: support 'git config --local'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-12T17:34:39Z","receivedAt":"2013-02-12T17:34:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> This needs to be done in two places: __git_config_get_set_variables to\n> allow clever completion of \"git config --local --get foo<tab>\", and\n> _git_config to allow \"git config --loc<tab>\" to complete to --local.\n>\n> While we're there, change the order of options in the code to match\n> git-config.txt.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>> I think this line should include --local:\n>> \n>> https://github.com/git/git/blob/next/contrib/completion/git-completion.bash#L1782\n>>     \"--global|--system|--file=*)\"\n>> \n>> This would help for:\n>>     git config -l --local\n>\n> Yes, but not only ;-)\n\nI see the second hunk is new.  Comments?\n\nHow would this interract with the writing side of \"git config\"?\n\"git config --local foo.bar value\" and \"git config foo.bar value\"\nare the same, no?\n\nIs it \"yes they are the same but it does not hurt?\"\n\n>  contrib/completion/git-completion.bash | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 5770b6f..2e1ad67 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1570,7 +1570,7 @@ __git_config_get_set_variables ()\n>  \twhile [ $c -gt 1 ]; do\n>  \t\tword=\"${words[c]}\"\n>  \t\tcase \"$word\" in\n> -\t\t--global|--system|--file=*)\n> +\t\t--system|--global|--local|--file=*)\n>  \t\t\tconfig_file=\"$word\"\n>  \t\t\tbreak\n>  \t\t\t;;\n> @@ -1676,7 +1676,7 @@ _git_config ()\n>  \tcase \"$cur\" in\n>  \t--*)\n>  \t\t__gitcomp \"\n> -\t\t\t--global --system --file=\n> +\t\t\t--system --global --local --file=\n>  \t\t\t--list --replace-all\n>  \t\t\t--get --get-all --get-regexp\n>  \t\t\t--add --unset --unset-all\n"},{"id":"209413","messageId":"20130212211140.GA29358@sigill.intra.peff.net","threadId":"32869","inReplyTo":"7vzjz9h1w0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] completion: support 'git config --local'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-02-12T21:11:40Z","receivedAt":"2013-02-12T21:11:40Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 12, 2013 at 09:34:39AM -0800, Junio C Hamano wrote:\n\n> I see the second hunk is new.  Comments?\n> [...]\n> > @@ -1676,7 +1676,7 @@ _git_config ()\n> >  \tcase \"$cur\" in\n> >  \t--*)\n> >  \t\t__gitcomp \"\n> > -\t\t\t--global --system --file=\n> > +\t\t\t--system --global --local --file=\n> >  \t\t\t--list --replace-all\n> >  \t\t\t--get --get-all --get-regexp\n> >  \t\t\t--add --unset --unset-all\n\nIt makes sense to me. It just means that \"--local\" itself gets completed\n(while the other hunk is about using the presence of \"--local\" impacting\nother completion). It's an orthogonal issue, but I don't mind them in\nthe same patch.\n\n> How would this interract with the writing side of \"git config\"?\n> \"git config --local foo.bar value\" and \"git config foo.bar value\"\n> are the same, no?\n> \n> Is it \"yes they are the same but it does not hurt?\"\n\nIt doesn't affect writing at all. The change is in\n__git_config_get_set_variables, which is used only here:\n\n  --get|--get-all|--unset|--unset-all)\n        __gitcomp_nl \"$(__git_config_get_set_variables)\"\n\nSo it is purely about completing existing variables, and it's right to\nlimit itself to a particular file if we know that is what has been\ngiven.\n\nI'm not sure I understand the original poster's point about \"git config\n-l --local\". \"-l\" does not take a limiter, does it?\n\n-Peff\n"},{"id":"209420","messageId":"7v1uclfafi.fsf@alter.siamese.dyndns.org","threadId":"32869","inReplyTo":"20130212211140.GA29358@sigill.intra.peff.net","subject":"Re: [PATCH] completion: support 'git config --local'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-12T22:13:05Z","receivedAt":"2013-02-12T22:13:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I'm not sure I understand the original poster's point about \"git config\n> -l --local\". \"-l\" does not take a limiter, does it?\n\n\"git config -l core.\\*\" will just die without limiting the output to\neverything under core. hierarchy, so you are right---the combination\ndoes not make any sense.  You have to say\n\n    git config -l | grep ^core\\\\.\n\nor something like that.\n\nCompleting \"git config -l --lo<TAB>\" still may help, though.\n"},{"id":"209441","messageId":"20130213000519.GA31758@sigill.intra.peff.net","threadId":"32869","inReplyTo":"7v1uclfafi.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] completion: support 'git config --local'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-02-13T00:05:19Z","receivedAt":"2013-02-13T00:05:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 12, 2013 at 02:13:05PM -0800, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > I'm not sure I understand the original poster's point about \"git config\n> > -l --local\". \"-l\" does not take a limiter, does it?\n> \n> \"git config -l core.\\*\" will just die without limiting the output to\n> everything under core. hierarchy, so you are right---the combination\n> does not make any sense.  You have to say\n> \n>     git config -l | grep ^core\\\\.\n> \n> or something like that.\n> \n> Completing \"git config -l --lo<TAB>\" still may help, though.\n\nAh, I think I see Dasa's original point now. He was interested in fixing\n\"--lo<TAB>\" to complete \"--local\". But the line he pointed to in his\noriginal message is not the right place for that; it is the site of an\nunrelated spot which should _also_ be fixed to use \"--local\", but for a\ndifferent reason (restricting the variables suggested for \"--local --get\n<TAB>\" properly).\n\nSo yeah. Matthieu's patch is the right thing to do, as it covers both\n(mine fixed only half of it).\n\n-Peff\n"},{"id":"209450","messageId":"vpqwqucu07x.fsf@grenoble-inp.fr","threadId":"32869","inReplyTo":"20130213000519.GA31758@sigill.intra.peff.net","subject":"Re: [PATCH] completion: support 'git config --local'","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-02-13T07:44:34Z","receivedAt":"2013-02-13T07:44:34Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jeff King <peff@peff.net> writes:\n\n> So yeah. Matthieu's patch is the right thing to do, as it covers both\n\nThanks,\n\n> (mine fixed only half of it).\n\n(Sorry, I had missed yours)\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}