Subject: Re: [PATCH 1/1] imap-send: include strbuf.h

From: Junio C Hamano <[email-masked]>
Date: Sat, 10 Feb 2024 18:42:28 -0800

Christian Hesse <[email-masked]> writes:

>> Oops, missing link:
>> 
>> https://lore.kernel.org/git/[email-masked]/
>
> Sorry, missed that... Probably because the breakage went into 2.43.1, but the
> upstream fix did not. So sorry for the noise.

Please don't be.  Duplicated reports are much much better than no
reports due to "well, this must have been reported already by
somebody else".  Thanks for reporting.

> Anyway... does it make sense to move the include into the condition?

I do not think so.  The original breakage was because it implicitly
relied on the fact that http.h, which is included only when
USE_CURL_FOR_IMAP_SEND is defined, happens to include strbuf.h, even
though the code that does not rely on USE_CURL_FOR_IMAP_SEND do
unconditionally rely on the strbuf facility being available to them,
possibly combined with the fact that not too many people build
imap-send with USE_CURL_FOR_IMAP_SEND disabled.

So the conditional thing still rely on an implicit assumption you
are making, i.e. "http.h will forever be including strbuf.h", which
is fragile when people from time to time come and make sweeping
"header clean-up".  Which is a good thing.  But we need to be
careful, and one way to help us being careful against such a header
clean-up is to make sure you include what you use yourself, instead
of assuming that somebody else you include will keep doing so.