Re: [PATCH 00/15] Handle fopen() errors

2017-04-23 Thread Junio C Hamano
Jeff King writes: > On Fri, Apr 21, 2017 at 07:27:20PM +0700, Duy Nguyen wrote: > >> On Fri, Apr 21, 2017 at 6:52 PM, Junio C Hamano wrote: >> > Yes, but (1) we'd need to be careful about --quiet >> >> Yeah. It's a real pain point for making changes like this.

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Jeff King
On Fri, Apr 21, 2017 at 07:27:20PM +0700, Duy Nguyen wrote: > On Fri, Apr 21, 2017 at 6:52 PM, Junio C Hamano wrote: > > Yes, but (1) we'd need to be careful about --quiet > > Yeah. It's a real pain point for making changes like this. At some > point we should just have a

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 6:52 PM, Junio C Hamano wrote: > Yes, but (1) we'd need to be careful about --quiet Yeah. It's a real pain point for making changes like this. At some point we should just have a global (maybe multi-level) quiet flag. -- Duy

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Junio C Hamano
On Fri, Apr 21, 2017 at 8:04 PM, Duy Nguyen wrote: > On Fri, Apr 21, 2017 at 1:29 PM, Jeff King wrote: >> >> I had a similar thought while reading through it. I think it would be >> shorter still with: >> >> FILE *fopen_or_warn(const char *path, const char

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 1:29 PM, Jeff King wrote: > On Thu, Apr 20, 2017 at 08:41:32PM -0700, Junio C Hamano wrote: > >> Junio C Hamano writes: >> >> > I wonder if it is OK to only special case ENOENT for !fp cases, >> > where existing code silently returns.

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Jeff King
On Thu, Apr 20, 2017 at 08:41:32PM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > I wonder if it is OK to only special case ENOENT for !fp cases, > > where existing code silently returns. Perhaps it is trying to read > > an optional file, and it returns silently

Re: [PATCH 00/15] Handle fopen() errors

2017-04-20 Thread Junio C Hamano
Junio C Hamano writes: > I wonder if it is OK to only special case ENOENT for !fp cases, > where existing code silently returns. Perhaps it is trying to read > an optional file, and it returns silently because lack of it is > perfectly OK for the purpose of the code. Are

Re: [PATCH 00/15] Handle fopen() errors

2017-04-20 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Some of you may recall a while back, nd/conditional-config-include > failed on Windows because I accidentally fopen()'d a directory in a > test, but it's not considered an serious error unless it's on Windows, > where fopen() returns NULL. > > A