Re: [PATCH GSoC RFC v13 06/12] connect: refactor packet writing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 24, 2026, 20:19 UTC
- Message-ID
- <xmqqpl1fhesc.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZSvxXuf_bSzKMvViNQ5MuDAqxnQdo4asF9vfMhJaDQcVw@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 11 quoted lines
>> +/* >> + * Writes a command along with the requested server capabilities/features into a >> + * request buffer. >> + */ >> struct string_list; > > The comment should be above the function and not the forward > declaration. > > While we're here, why not `#include "string-list.h"` and remove the > forward declaration, is there a circular dependency?
Isn't it to avoid unnecessary include? When the header itself only needs to know about the presence of the type, and not the concrete shape of the type (e.g., because it only uses a pointer to that type), it may be overkill to include the entire header file.