Subject: Re: [PATCH 2/7] object.c: make type_from_string() return "enum object_type"

From: Taylor Blau <[email-masked]>
Date: Mon, 8 Mar 2021 15:56:57 -0500

On Mon, Mar 08, 2021 at 09:04:21PM +0100, Ævar Arnfjörð Bjarmason wrote:
> Change the type_from_string*() functions to return an "enum
> object_type", and refactor their callers to check for "== OBJ_BAD"
> instead of "< 0".
>
> This helps to distinguish code in object.c where we really do return
> -1 from code that returns an "enum object_type", whose OBJ_BAD happens
> to be -1.

I'm not sure I understand the intention of this and the following few
patches. I could imagine that you eventually want to use other negative
return values for a different purpose, but OBJ_BAD _is_ '-1' (as you
note), and we use 'int' and 'enum object_type' interchangeably in other
parts of the code.

That's not to say that I'm necessarily opposed to picking up these few
patches, but rather that I don't fully understand their purpose.

The patch below looks good.

Thanks,
Taylor