Re: [PATCH 2/3] gc: exit with status 128 on failure
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 17, 2018, 18:40 UTC
- Message-ID
- <20180917184012.GD140909@aiede.svl.corp.google.com>
- In-Reply-To
- <20180917183336.GA4630@sigill.intra.peff.net>
Hi,
Jeff King wrote:
> On Tue, Jul 17, 2018 at 03:59:47PM -0400, Jeff King wrote: >> On Mon, Jul 16, 2018 at 11:54:16PM -0700, Jonathan Nieder wrote:
Show 11 quoted lines
>>> A value of -1 returned from cmd_gc gets propagated to exit(), >>> resulting in an exit status of 255. Use die instead for a clearer >>> error message and a controlled exit. >> >> This feels a little funny because we know we're going to turn some of >> these back in the next patch. That said, I'm OK with it, since this >> version is already written. > > There's discussion elsewhere[1] of applying just up to patch 2. > > Do we still want to convert these cases to die() as their end-state?
IMHO yes, we do. die() is the function that you can use to exit with a fatal error.
If we want to get rid of die(), that would be a tree-wide effort, not something that should hold up this patch.
[...]
> It also makes the code more flexible and lib-ifiable (since the caller > can decide how to handle the errors). That probably doesn't matter much > since this is all static-local to builtin/gc.c,
Exactly. I'm a strong believer in http://wiki.c2.com/?YouArentGonnaNeedIt.
Thanks, Jonathan