{"thread":{"id":"41988","subject":"[PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line","startedAt":"2016-04-11T07:48:48Z","lastAt":"2016-04-12T22:31:50Z","messageCount":2,"participants":["Stan Hu","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"283130","messageId":"1460360928-95956-1-git-send-email-stanhu@gmail.com","threadId":"41988","inReplyTo":null,"subject":"[PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line","fromName":"Stan Hu","fromEmail":"stanhu@gmail.com","sentAt":"2016-04-11T07:48:48Z","receivedAt":"2016-04-11T07:48:48Z","isPatch":true,"sender":{"key":"stanhu@gmail.com","avatar":"https://avatars.githubusercontent.com/u/963826?v=4"},"body":"The pkt-line format mandates: \"a sender should include a LF, but the\nreceive MUST NOT complain if it is not present.\" This patch\nis not absolutely necessary since receivers handle the missing the LF,\nbut this patch adds it for good measure.\n\nSigned-off-by: Stan Hu <stanhu@gmail.com>\n---\n fetch-pack.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex f96f6df..77299d9 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -330,7 +330,7 @@ static int find_common(struct fetch_pack_args *args,\n \tif (is_repository_shallow())\n \t\twrite_shallow_commits(&req_buf, 1, NULL);\n \tif (args->depth > 0)\n-\t\tpacket_buf_write(&req_buf, \"deepen %d\", args->depth);\n+\t\tpacket_buf_write(&req_buf, \"deepen %d\\n\", args->depth);\n \tpacket_buf_flush(&req_buf);\n \tstate_len = req_buf.len;\n \n-- \n2.7.3\n"},{"id":"283227","messageId":"xmqqpotuo3vt.fsf@gitster.mtv.corp.google.com","threadId":"41988","inReplyTo":"1460360928-95956-1-git-send-email-stanhu@gmail.com","subject":"Re: [PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-12T22:31:50Z","receivedAt":"2016-04-12T22:31:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stan Hu <stanhu@gmail.com> writes:\n\n> The pkt-line format mandates: \"a sender should include a LF, but the\n> receive MUST NOT complain if it is not present.\" This patch\n> is not absolutely necessary since receivers handle the missing the LF,\n> but this patch adds it for good measure.\n\ns/since receivers handle/since receivers are expected to handle/;\n\nHave you checked various re-implementations of upload-pack to see\nwhich one will break with this change, and made them aware about\ntheir non-compliance?\n\n>\n> Signed-off-by: Stan Hu <stanhu@gmail.com>\n> ---\n>  fetch-pack.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/fetch-pack.c b/fetch-pack.c\n> index f96f6df..77299d9 100644\n> --- a/fetch-pack.c\n> +++ b/fetch-pack.c\n> @@ -330,7 +330,7 @@ static int find_common(struct fetch_pack_args *args,\n>  \tif (is_repository_shallow())\n>  \t\twrite_shallow_commits(&req_buf, 1, NULL);\n>  \tif (args->depth > 0)\n> -\t\tpacket_buf_write(&req_buf, \"deepen %d\", args->depth);\n> +\t\tpacket_buf_write(&req_buf, \"deepen %d\\n\", args->depth);\n>  \tpacket_buf_flush(&req_buf);\n>  \tstate_len = req_buf.len;\n"}]}