* [PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line
@ 2016-04-11 7:48 Stan Hu
2016-04-12 22:31 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Stan Hu @ 2016-04-11 7:48 UTC (permalink / raw)
To: gitster; +Cc: git, Stan Hu
The pkt-line format mandates: "a sender should include a LF, but the
receive MUST NOT complain if it is not present." This patch
is not absolutely necessary since receivers handle the missing the LF,
but this patch adds it for good measure.
Signed-off-by: Stan Hu <stanhu@gmail.com>
---
fetch-pack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index f96f6df..77299d9 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -330,7 +330,7 @@ static int find_common(struct fetch_pack_args *args,
if (is_repository_shallow())
write_shallow_commits(&req_buf, 1, NULL);
if (args->depth > 0)
- packet_buf_write(&req_buf, "deepen %d", args->depth);
+ packet_buf_write(&req_buf, "deepen %d\n", args->depth);
packet_buf_flush(&req_buf);
state_len = req_buf.len;
--
2.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line
2016-04-11 7:48 [PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line Stan Hu
@ 2016-04-12 22:31 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2016-04-12 22:31 UTC (permalink / raw)
To: Stan Hu; +Cc: git
Stan Hu <stanhu@gmail.com> writes:
> The pkt-line format mandates: "a sender should include a LF, but the
> receive MUST NOT complain if it is not present." This patch
> is not absolutely necessary since receivers handle the missing the LF,
> but this patch adds it for good measure.
s/since receivers handle/since receivers are expected to handle/;
Have you checked various re-implementations of upload-pack to see
which one will break with this change, and made them aware about
their non-compliance?
>
> Signed-off-by: Stan Hu <stanhu@gmail.com>
> ---
> fetch-pack.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fetch-pack.c b/fetch-pack.c
> index f96f6df..77299d9 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -330,7 +330,7 @@ static int find_common(struct fetch_pack_args *args,
> if (is_repository_shallow())
> write_shallow_commits(&req_buf, 1, NULL);
> if (args->depth > 0)
> - packet_buf_write(&req_buf, "deepen %d", args->depth);
> + packet_buf_write(&req_buf, "deepen %d\n", args->depth);
> packet_buf_flush(&req_buf);
> state_len = req_buf.len;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-12 22:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 7:48 [PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line Stan Hu
2016-04-12 22:31 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).