Subject: Re: [PATCH 1/6] strbuf.h: move declarations for strbuf.c functions from git-compat-util.h

From: Junio C Hamano <[email-masked]>
Date: Tue, 16 May 2023 14:18:40 -0700

Calvin Wan <[email-masked]> writes:

> While functions like starts_with() probably should not belong in the
> boundaries of the strbuf library, this commit focuses on first splitting
> out headers from git-compat-util.h.

Yeah, compat-util.h started out as a (surprise) "compatibility aid"
that isolates the knowledge of platform specific inclusion order,
what feature macros to define before including which system header
file, etc. but over the years, it accumulated some common niceties
that are too small to deserve their own header files.

starts_with() and skip_prefix() are two examples of such.  

It is hard to imagine skip_to_optional_arg_default() should belong
to strbuf API, but if you are booting it out of compat-util,
declaring it in strbuf.h may be the least bad choice, as the
implementation sits in strbuf.c (which is a strange place, but that
is not the fault of this series).