git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 11, 2024, 02:42 UTC
Message-ID
<xmqq7cjbbu23.fsf@gitster.g>
In-Reply-To
<20240210210155.71fa163d@leda.eworm.net>
Christian Hesse <list@eworm.de> writes:
Show 6 quoted lines
>> Oops, missing link:
>> 
>> https://lore.kernel.org/git/pull.1664.git.git.1706833113569.gitgitgadget@gmail.com/
>
> 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.

Previous: Christian Hesse
Message 5 of 5 in “imap-send: include strbuf.h”
  1. 1/1 imap-send: include strbuf.hChristian Hesse, Feb 9, 2024
  2. Junio C HamanoFeb 9, 2024
  3. Junio C HamanoFeb 9, 2024
  4. Christian HesseFeb 10, 2024
  5. Junio C HamanoFeb 11, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.