Re: [PATCH v2 3/8] object.c: add and use oid_is_type_or_die_msg() function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 28, 2021, 04:12 UTC
- Message-ID
- <xmqq7dkncaiu.fsf@gitster.g>
- In-Reply-To
- <YIC1IcpKCXh3qoun@google.com>
Josh Steadmon <steadmon@google.com> writes:
Show 15 quoted lines
> On 2021.04.20 15:36, Ævar Arnfjörð Bjarmason wrote: >> diff --git a/object.c b/object.c >> index 9e06c0ee92..0f07f976fb 100644 >> --- a/object.c >> +++ b/object.c >> @@ -176,6 +176,18 @@ int oid_is_type_or_error(const struct object_id *oid, >> type_name(want)); >> } >> >> +char* oid_is_type_or_die_msg(const struct object_id *oid, > > It's kind of a nitpick, but I found the function name to be confusing. > It sounds like you're going to die with a custom message. Maybe > something like "get_oid_type_mismatch_msg()" would be more > straightforward.
Yeah, in an older round I found this function's name was confusing, too.
Also, there is a style (in our codebase, asterisk to signal the pointer-ness sticks to the identifier, not to the type name).
Thanks.