Subject: Re: [PATCH 1/2] config: return positive from git_config_parse_key()

From: Junio C Hamano <[email-masked]>
Date: Fri, 21 Jul 2023 09:36:12 -0700

Glen Choo <[email-masked]> writes:

> Oh, interesting. I was trying to follow the conventions of the
> surrounding config.c code and many other parts of the codebase, which
> returns positive values. Why do we choose to return postive values
> throughout the codebase, by the way? Is it because they were really
> intended for exit(3), and not to be used as a library.

If config.c does that, I'd say that was poorly designed oddball.
Looking at read-cache.c (which is older parts of the codebase
written back when the developer base was smaller) may give you a
better examples to follow.  After all, error() returns negative
exactly because we want to follow the usual "negative is an error"
convention.