Re: [RFC/PATCH 0/2] Re: [PATCH] config: warn on inaccessible files
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 14, 2012, 09:00 UTC
- Message-ID
- <20121014090041.GE7190@elie.Belkin>
- In-Reply-To
- <7vhapx1wlh.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 8 quoted lines
> If the config side can
> be switched to unconditionally attempt to fopen and then deal with
> an error when it happens, we can get rid of access_or_{warn,die}
> and replace them with fopen_or_{warn,die} and use them from the two
> places (attr.c:read_attr_from_file() and the configuration stuff).
>
> I haven't looked to see if that a too intrusive refactoring to be
> worth it, though.That sounds reasonable, but I'm punting on it. The first step would be tweaking the git_config_from_file() calling convention to convey "missing file" errors specially, perhaps by making sure errno is meaningful when the return value is -1, and that already sounds like work. ;-)
Thanks, Jonathan