{"thread":{"id":"60889","subject":"[PATCH 1/1] imap-send: include strbuf.h","startedAt":"2024-02-09T22:32:05Z","lastAt":"2024-02-11T02:42:37Z","messageCount":5,"participants":["Christian Hesse","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"488325","messageId":"20240209222622.102208-1-list@eworm.de","threadId":"60889","inReplyTo":null,"subject":"[PATCH 1/1] imap-send: include strbuf.h","fromName":"Christian Hesse","fromEmail":"list@eworm.de","sentAt":"2024-02-09T22:26:22Z","receivedAt":"2024-02-09T22:32:05Z","isPatch":true,"sender":{"key":"list@eworm.de","avatar":"https://gravatar.com/avatar/ec9a78d63ae8bf8efdc06867449c0a3e763066c462c2c2f9f103ac4675109e14?d=mp&s=160"},"body":"From: Christian Hesse <mail@eworm.de>\n\nWe had this fixed in 3307f7dde2ae8f5281d0782f7291a073c9b1cdc2,\nand it broke again in eea0e59ffbed6e33d171ace5be13cde9faa41639.\n\nWe make liberal use of the strbuf API functions and types, but the\ninclusion of <strbuf.h> comes indirectly by including <http.h>,\nwhich does not happen if you build with NO_CURL.\n\nThis time make the include conditional... Does that prevent from\nloosing it again?\n\nSigned-off-by: Christian Hesse <mail@eworm.de>\n---\n imap-send.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex f2e1947e63..cae494c663 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -34,6 +34,8 @@ typedef void *SSL;\n #endif\n #ifdef USE_CURL_FOR_IMAP_SEND\n #include \"http.h\"\n+#else\n+#include \"strbuf.h\"\n #endif\n \n #if defined(USE_CURL_FOR_IMAP_SEND)\n-- \n2.43.1\n\n"},{"id":"488326","messageId":"xmqqil2xcl9e.fsf@gitster.g","threadId":"60889","inReplyTo":"20240209222622.102208-1-list@eworm.de","subject":"Re: [PATCH 1/1] imap-send: include strbuf.h","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-09T22:42:37Z","receivedAt":"2024-02-09T22:42:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Hesse <list@eworm.de> writes:\n\n> From: Christian Hesse <mail@eworm.de>\n>\n> We had this fixed in 3307f7dde2ae8f5281d0782f7291a073c9b1cdc2,\n> and it broke again in eea0e59ffbed6e33d171ace5be13cde9faa41639.\n\nThanks, already reported and fixed, I believe?\n"},{"id":"488327","messageId":"xmqqeddlckqa.fsf@gitster.g","threadId":"60889","inReplyTo":"xmqqil2xcl9e.fsf@gitster.g","subject":"Re: [PATCH 1/1] imap-send: include strbuf.h","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-09T22:54:05Z","receivedAt":"2024-02-09T22:54:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Christian Hesse <list@eworm.de> writes:\n>\n>> From: Christian Hesse <mail@eworm.de>\n>>\n>> We had this fixed in 3307f7dde2ae8f5281d0782f7291a073c9b1cdc2,\n>> and it broke again in eea0e59ffbed6e33d171ace5be13cde9faa41639.\n>\n> Thanks, already reported and fixed, I believe?\n\nOops, missing link:\n\nhttps://lore.kernel.org/git/pull.1664.git.git.1706833113569.gitgitgadget@gmail.com/\n\n"},{"id":"488374","messageId":"20240210210155.71fa163d@leda.eworm.net","threadId":"60889","inReplyTo":"xmqqeddlckqa.fsf@gitster.g","subject":"Re: [PATCH 1/1] imap-send: include strbuf.h","fromName":"Christian Hesse","fromEmail":"list@eworm.de","sentAt":"2024-02-10T20:01:55Z","receivedAt":"2024-02-10T20:01:58Z","isPatch":true,"sender":{"key":"list@eworm.de","avatar":"https://gravatar.com/avatar/ec9a78d63ae8bf8efdc06867449c0a3e763066c462c2c2f9f103ac4675109e14?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> on Fri, 2024/02/09 14:54:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Christian Hesse <list@eworm.de> writes:\n> >  \n> >> From: Christian Hesse <mail@eworm.de>\n> >>\n> >> We had this fixed in 3307f7dde2ae8f5281d0782f7291a073c9b1cdc2,\n> >> and it broke again in eea0e59ffbed6e33d171ace5be13cde9faa41639.  \n> >\n> > Thanks, already reported and fixed, I believe?  \n> \n> Oops, missing link:\n> \n> https://lore.kernel.org/git/pull.1664.git.git.1706833113569.gitgitgadget@gmail.com/\n\nSorry, missed that... Probably because the breakage went into 2.43.1, but the\nupstream fix did not. So sorry for the noise.\n\nAnyway... does it make sense to move the include into the condition?\n-- \nmain(a){char*c=/*    Schoene Gruesse                         */\"B?IJj;MEH\"\n\"CX:;\",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)\nputchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}\n"},{"id":"488380","messageId":"xmqq7cjbbu23.fsf@gitster.g","threadId":"60889","inReplyTo":"20240210210155.71fa163d@leda.eworm.net","subject":"Re: [PATCH 1/1] imap-send: include strbuf.h","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-11T02:42:28Z","receivedAt":"2024-02-11T02:42:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Hesse <list@eworm.de> writes:\n\n>> Oops, missing link:\n>> \n>> https://lore.kernel.org/git/pull.1664.git.git.1706833113569.gitgitgadget@gmail.com/\n>\n> Sorry, missed that... Probably because the breakage went into 2.43.1, but the\n> upstream fix did not. So sorry for the noise.\n\nPlease don't be.  Duplicated reports are much much better than no\nreports due to \"well, this must have been reported already by\nsomebody else\".  Thanks for reporting.\n\n> Anyway... does it make sense to move the include into the condition?\n\nI do not think so.  The original breakage was because it implicitly\nrelied on the fact that http.h, which is included only when\nUSE_CURL_FOR_IMAP_SEND is defined, happens to include strbuf.h, even\nthough the code that does not rely on USE_CURL_FOR_IMAP_SEND do\nunconditionally rely on the strbuf facility being available to them,\npossibly combined with the fact that not too many people build\nimap-send with USE_CURL_FOR_IMAP_SEND disabled.\n\nSo the conditional thing still rely on an implicit assumption you\nare making, i.e. \"http.h will forever be including strbuf.h\", which\nis fragile when people from time to time come and make sweeping\n\"header clean-up\".  Which is a good thing.  But we need to be\ncareful, and one way to help us being careful against such a header\nclean-up is to make sure you include what you use yourself, instead\nof assuming that somebody else you include will keep doing so.\n\n"}]}