From: Jeff King <peff@peff.net>
To: james bardin <jbardin@bu.edu>
Cc: Todd Zullinger <tmz@pobox.com>, git@vger.kernel.org
Subject: Re: bash_completion outside repo
Date: Fri, 11 Sep 2009 10:17:30 -0400 [thread overview]
Message-ID: <20090911141730.GA384@coredump.intra.peff.net> (raw)
In-Reply-To: <a3b675320909110700k7eb7286qc8cb5691aae214c7@mail.gmail.com>
On Fri, Sep 11, 2009 at 10:00:33AM -0400, james bardin wrote:
> I did a make install, and dropped the completion file in
> /etc/bash_completion.d/. No other settings changed. I did a quick
> check, and it happens with the current 1.6.5 snapshot too, and on a
> fedora 10 box I found.
>
> It seems I only get this error if I don't have a global config.
> Touching ~/.gitconfig stops the error.
Ah, I see. It looks like we use "git config --list" to view several bits
of configuration. However, it is not happy if there is no config file to
list.
However, I'm not sure that "config --list" isn't broken. Inside a repo,
doing "git config --list" shows the repo config and my global config,
and exits with no error. Outside a repo, it shows my global config, and
exits with no error. But if I _don't_ have global config, it produces an
error. Shouldn't it treat that as simply "no config is available"?
I also question why it is using "git config --list" at all in snippets
like this:
for i in $(git --git-dir="$d" config --list); do
case "$i" in
remote.*.url=*)
i="${i#remote.}"
echo "${i/.url=*/}"
;;
esac
done
instead of just using "git config --get-regexp 'remote\..*\.url'", which
would be slightly more efficient, and also doesn't have this bug. ;)
-Peff
next prev parent reply other threads:[~2009-09-11 14:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-10 15:13 bash_completion outside repo james bardin
2009-09-11 13:11 ` Michael J Gruber
2009-09-11 13:33 ` Todd Zullinger
2009-09-11 14:00 ` james bardin
2009-09-11 14:17 ` Jeff King [this message]
2009-09-11 14:36 ` Shawn O. Pearce
2009-09-11 15:09 ` Jeff King
2009-09-11 16:47 ` Jeff King
2009-09-11 20:43 ` Junio C Hamano
2009-09-11 21:12 ` Jeff King
2009-09-11 21:22 ` Junio C Hamano
2009-09-11 21:29 ` Jeff King
2009-09-11 21:57 ` Junio C Hamano
2009-09-11 22:04 ` Junio C Hamano
2009-09-11 22:05 ` Jeff King
2009-09-11 23:23 ` [PATCH] completion: Replace config --list with --get-regexp Todd Zullinger
2009-09-12 18:31 ` Shawn O. Pearce
2009-09-13 10:51 ` Bert Wesarg
2009-09-13 18:29 ` Todd Zullinger
2009-09-13 20:40 ` Junio C Hamano
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=20090911141730.GA384@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=jbardin@bu.edu \
--cc=tmz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.