Re: [RFC 03/14] upload-pack: test negotiation with changing repo

2 messages, 2 authors, 2017-02-23 · open the first message on its own page

Re: [RFC 03/14] upload-pack: test negotiation with changing repo

From: Junio C Hamano <hidden>
Date: 2017-02-22 23:36:44

Jonathan Tan [off-list ref] writes:
quoted
This somehow looks like a good thing to do even in production.  Am I
mistaken?
Yes, that's true. If this patch set stalls (for whatever reason), I'll
spin this off into an independent patch.
... which may be needed.

As to the main goal of this topic, I think the "ask by refname (with
glob)" is very good thing to start the "client speaks first" v2
protocol, as it would allow us to reduce the size of the initial
advertisement for common cases (i.e. remote.<name>.fetch is likely
to list only refs/heads/* on the left hand side of a refspec).  And
adding this to v1 is probably a good first step to make sure the
code that is currently used by v1 protocol exchange that will be
shared with the v2 protocols are prepared to be driven by refname
without knowing the exact object name until the final round.


[PATCH] upload-pack: report "not our ref" to client

From: Jonathan Tan <hidden>
Date: 2017-02-23 18:52:26

Make upload-pack report "not our ref" errors to the client as an "ERR" line.
(If not, the client would be left waiting for a response when the server is
already dead.)

Signed-off-by: Jonathan Tan <redacted>
---

Thanks, here is the independent patch.

 upload-pack.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/upload-pack.c b/upload-pack.c
index 7597ba340..ffb028d62 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -822,9 +822,13 @@ static void receive_needs(void)
 			use_include_tag = 1;
 
 		o = parse_object(sha1_buf);
-		if (!o)
+		if (!o) {
+			packet_write_fmt(1,
+					 "ERR upload-pack: not our ref %s",
+					 sha1_to_hex(sha1_buf));
 			die("git upload-pack: not our ref %s",
 			    sha1_to_hex(sha1_buf));
+		}
 		if (!(o->flags & WANTED)) {
 			o->flags |= WANTED;
 			if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1
-- 
2.11.0.483.g087da7b7c-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help