git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>,
	git@vger.kernel.org, Dasa Paddock <dpaddock@esri.com>
Subject: Re: [PATCH] completion: support 'git config --local'
Date: Tue, 12 Feb 2013 16:11:40 -0500	[thread overview]
Message-ID: <20130212211140.GA29358@sigill.intra.peff.net> (raw)
In-Reply-To: <7vzjz9h1w0.fsf@alter.siamese.dyndns.org>

On Tue, Feb 12, 2013 at 09:34:39AM -0800, Junio C Hamano wrote:

> I see the second hunk is new.  Comments?
> [...]
> > @@ -1676,7 +1676,7 @@ _git_config ()
> >  	case "$cur" in
> >  	--*)
> >  		__gitcomp "
> > -			--global --system --file=
> > +			--system --global --local --file=
> >  			--list --replace-all
> >  			--get --get-all --get-regexp
> >  			--add --unset --unset-all

It makes sense to me. It just means that "--local" itself gets completed
(while the other hunk is about using the presence of "--local" impacting
other completion). It's an orthogonal issue, but I don't mind them in
the same patch.

> How would this interract with the writing side of "git config"?
> "git config --local foo.bar value" and "git config foo.bar value"
> are the same, no?
> 
> Is it "yes they are the same but it does not hurt?"

It doesn't affect writing at all. The change is in
__git_config_get_set_variables, which is used only here:

  --get|--get-all|--unset|--unset-all)
        __gitcomp_nl "$(__git_config_get_set_variables)"

So it is purely about completing existing variables, and it's right to
limit itself to a particular file if we know that is what has been
given.

I'm not sure I understand the original poster's point about "git config
-l --local". "-l" does not take a limiter, does it?

-Peff

  reply	other threads:[~2013-02-12 21:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 18:37 git-completion.bash --local Dasa Paddock
2013-02-11 21:04 ` Jeff King
2013-02-12  5:49   ` [PATCH] completion: recognize "--local" as a config file source Jeff King
2013-02-12 12:20 ` [PATCH] completion: support 'git config --local' Matthieu Moy
2013-02-12 17:34   ` Junio C Hamano
2013-02-12 21:11     ` Jeff King [this message]
2013-02-12 22:13       ` Junio C Hamano
2013-02-13  0:05         ` Jeff King
2013-02-13  7:44           ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130212211140.GA29358@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@imag.fr \
    --cc=dpaddock@esri.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).