Re: [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]