git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default
Date: Thu, 23 Apr 2009 20:37:26 +0200	[thread overview]
Message-ID: <200904232037.27095.j6t@kdbg.org> (raw)
In-Reply-To: <20090423164008.GA26346@coredump.intra.peff.net>

On Donnerstag, 23. April 2009, Jeff King wrote:
> On Thu, Apr 23, 2009 at 03:49:05PM +0200, Johannes Sixt wrote:
> > Typos in configuration keys usually do not hurt because they never match
> > in look-ups. But this case is different: it does match, but it does not
> > have the expected format. With this patch this situation is treated more
> > like a typo.
>
> I definitely think causing the command to fail is bad, but should we
> perhaps still warn the user? I know that we can't catch _every_ typo in
> the config, but if there is something obviously wrong that we've
> detected, it is nice to let the user know.
>
> > -		return error("Config with no key for remote %s", name);
> > +		return 0;
>
> IOW,
>
>   + warn("Config with no key for remote %s", name);
>   + return 0;

I don't like this. This would warn in a number of situations where it's not 
obvious that remotes are involved, for example in 'git status'.

Also observe (and I forgot to mention that in the commit message) that this 
same exit

   if (!subkey)
        return 0;

is also taken for url.foo and branch.foo configurations a few lines above this 
change.

-- Hannes

  reply	other threads:[~2009-04-23 18:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 13:49 [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default Johannes Sixt
2009-04-23 13:49 ` [PATCH 2/2] builtin-help: silently tolerate unknown keys Johannes Sixt
2009-04-23 16:40 ` [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default Jeff King
2009-04-23 18:37   ` Johannes Sixt [this message]
2009-04-23 20:01     ` Jeff King
2009-04-24 16:19 ` 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=200904232037.27095.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).