Subject: Why do we have both x*() and *_or_die() for "do or die"?

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Tue, 22 May 2018 19:49:33 +0200

On Wed, May 16 2018, Stefan Beller wrote:

> A common pattern with the repo_read_index function is to die if the return
> of repo_read_index is negative.  Move this pattern into a function.

Just a side-question unrelated to this patch per-se, why do we have both
x*() and *_or_die() functions in the codebase? I can't find any pattern
for one or the other, e.g. we have both xopen() and then write_or_die(),
so it's not a matter of x*() just being for syscalls and *_or_die()
being for our own functions (also as e.g. strbuf uses x*(), not
*_or_die()).

I'm not trying to litigate the difference and understand it could have
just emerged organically. I'm just wondering if that's the full story or
if one is preferred, or we prefer one or the other in some
circumstances.