{"thread":{"id":"58210","subject":"[PATCH] pkt-line.h: move comment closer to the associated code","startedAt":"2022-07-22T11:10:17Z","lastAt":"2022-07-22T12:47:35Z","messageCount":3,"participants":["Matheus Tavares","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"459768","messageId":"6a14443c101fa132498297af6d7a483520688d75.1658488203.git.matheus.bernardino@usp.br","threadId":"58210","inReplyTo":null,"subject":"[PATCH] pkt-line.h: move comment closer to the associated code","fromName":"Matheus Tavares","fromEmail":"matheus.bernardino@usp.br","sentAt":"2022-07-22T11:10:05Z","receivedAt":"2022-07-22T11:10:17Z","isPatch":true,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"ec9a37d (\"pkt-line.[ch]: remove unused packet_read_line_buf()\",\n2021-10-14) removed the \"src_buffer\" and \"src_len\" parameters from\npacket_read(), only leaving them at packet_read_with_status(). Let's\nalso update the function documentation by moving the comment about these\nparameters from the former to the latter.\n\nSigned-off-by: Matheus Tavares <matheus.bernardino@usp.br>\n---\n pkt-line.h | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/pkt-line.h b/pkt-line.h\nindex 6d2a63db23..1f623de60a 100644\n--- a/pkt-line.h\n+++ b/pkt-line.h\n@@ -49,14 +49,6 @@ void packet_fflush(FILE *f);\n  * Read a packetized line into the buffer, which must be at least size bytes\n  * long. The return value specifies the number of bytes read into the buffer.\n  *\n- * If src_buffer and *src_buffer are not NULL, it should point to a buffer\n- * containing the packet data to parse, of at least *src_len bytes.  After the\n- * function returns, src_buf will be incremented and src_len decremented by the\n- * number of bytes consumed.\n- *\n- * If src_buffer (or *src_buffer) is NULL, then data is read from the\n- * descriptor \"fd\".\n- *\n  * If options does not contain PACKET_READ_GENTLE_ON_EOF, we will die under any\n  * of the following conditions:\n  *\n@@ -104,6 +96,14 @@ int packet_length(const char lenbuf_hex[4]);\n  * returns an 'enum packet_read_status' which indicates the status of the read.\n  * The number of bytes read will be assigned to *pktlen if the status of the\n  * read was 'PACKET_READ_NORMAL'.\n+ *\n+ * If src_buffer and *src_buffer are not NULL, it should point to a buffer\n+ * containing the packet data to parse, of at least *src_len bytes.  After the\n+ * function returns, src_buf will be incremented and src_len decremented by the\n+ * number of bytes consumed.\n+ *\n+ * If src_buffer (or *src_buffer) is NULL, then data is read from the\n+ * descriptor \"fd\".\n  */\n enum packet_read_status {\n \tPACKET_READ_EOF,\n-- \n2.37.1\n\n"},{"id":"459770","messageId":"220722.867d45s81o.gmgdl@evledraar.gmail.com","threadId":"58210","inReplyTo":"6a14443c101fa132498297af6d7a483520688d75.1658488203.git.matheus.bernardino@usp.br","subject":"Re: [PATCH] pkt-line.h: move comment closer to the associated code","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-07-22T11:19:37Z","receivedAt":"2022-07-22T11:26:01Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Jul 22 2022, Matheus Tavares wrote:\n\n> ec9a37d (\"pkt-line.[ch]: remove unused packet_read_line_buf()\",\n\nNit: \"log --pretty=reference\" for me emits this length of SHA-1 on a\nfresh clone:\n\n\tec9a37d69b (pkt-line.[ch]: remove unused packet_read_line_buf(), 2021-10-14)\n\nIn this case ec9a3 is non-colliding, but you might want to adjust\nwhatever your local alias is to use our default hash length instead of a\npresumably hardcoded length of 7 ;)\n\nNo need to re-roll for that...\n\n> 2021-10-14) removed the \"src_buffer\" and \"src_len\" parameters from\n> packet_read(), only leaving them at packet_read_with_status(). Let's\n> also update the function documentation by moving the comment about these\n> parameters from the former to the latter.\n>\n> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>\n> ---\n>  pkt-line.h | 16 ++++++++--------\n>  1 file changed, 8 insertions(+), 8 deletions(-)\n>\n> diff --git a/pkt-line.h b/pkt-line.h\n> index 6d2a63db23..1f623de60a 100644\n> --- a/pkt-line.h\n> +++ b/pkt-line.h\n> @@ -49,14 +49,6 @@ void packet_fflush(FILE *f);\n>   * Read a packetized line into the buffer, which must be at least size bytes\n>   * long. The return value specifies the number of bytes read into the buffer.\n>   *\n> - * If src_buffer and *src_buffer are not NULL, it should point to a buffer\n> - * containing the packet data to parse, of at least *src_len bytes.  After the\n> - * function returns, src_buf will be incremented and src_len decremented by the\n> - * number of bytes consumed.\n> - *\n> - * If src_buffer (or *src_buffer) is NULL, then data is read from the\n> - * descriptor \"fd\".\n> - *\n>   * If options does not contain PACKET_READ_GENTLE_ON_EOF, we will die under any\n>   * of the following conditions:\n>   *\n> @@ -104,6 +96,14 @@ int packet_length(const char lenbuf_hex[4]);\n>   * returns an 'enum packet_read_status' which indicates the status of the read.\n>   * The number of bytes read will be assigned to *pktlen if the status of the\n>   * read was 'PACKET_READ_NORMAL'.\n> + *\n> + * If src_buffer and *src_buffer are not NULL, it should point to a buffer\n> + * containing the packet data to parse, of at least *src_len bytes.  After the\n> + * function returns, src_buf will be incremented and src_len decremented by the\n> + * number of bytes consumed.\n> + *\n> + * If src_buffer (or *src_buffer) is NULL, then data is read from the\n> + * descriptor \"fd\".\n>   */\n>  enum packet_read_status {\n>  \tPACKET_READ_EOF,\n\nThis change looks good to me, thanks for catching this & cleaning up\nafter my change.\n"},{"id":"459772","messageId":"CAHd-oW6HBkZPFR-vKwVSLBkqic=eSiWY8EY1T4ZNEzCk+Lx6Bw@mail.gmail.com","threadId":"58210","inReplyTo":"220722.867d45s81o.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH] pkt-line.h: move comment closer to the associated code","fromName":"Matheus Tavares","fromEmail":"matheus.bernardino@usp.br","sentAt":"2022-07-22T12:47:18Z","receivedAt":"2022-07-22T12:47:35Z","isPatch":true,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"On Fri, Jul 22, 2022 at 8:25 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Fri, Jul 22 2022, Matheus Tavares wrote:\n>\n> > ec9a37d (\"pkt-line.[ch]: remove unused packet_read_line_buf()\",\n>\n> Nit: \"log --pretty=reference\" for me emits this length of SHA-1 on a\n> fresh clone:\n>\n>         ec9a37d69b (pkt-line.[ch]: remove unused packet_read_line_buf(), 2021-10-14)\n>\n> In this case ec9a3 is non-colliding, but you might want to adjust\n> whatever your local alias is to use our default hash length instead of a\n> presumably hardcoded length of 7 ;)\n\nThanks, will do :)\n"}]}