From: Jonathan Nieder Date: Sun, 14 Oct 2012 09:00:42 GMT Subject: Re: [RFC/PATCH 0/2] Re: [PATCH] config: warn on inaccessible files Message-ID: <20121014090041.GE7190@elie.Belkin> In-Reply-To: <7vhapx1wlh.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > 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