Thread (15 messages) flat view 15 messages, 4 authors, 2021-08-16

Re: [PATCH v2 2/2] connect, protocol: log negotiated protocol version

From: Eric Sunshine <hidden>
Date: 2021-08-04 22:29:00

On Wed, Aug 4, 2021 at 6:17 PM Josh Steadmon [off-list ref] wrote:
quoted hunk ↗ jump to hunk
It is useful for performance monitoring and debugging purposes to know
the wire protocol used for remote operations. This may differ from the
version set in local configuration due to differences in version and/or
configuration between the server and the client. Therefore, log the
negotiated wire protocol version via trace2, for both clients and
servers.

Signed-off-by: Josh Steadmon <redacted>
---
diff --git a/t/t5705-session-id-in-capabilities.sh b/t/t5705-session-id-in-capabilities.sh
@@ -73,6 +74,17 @@ do
+       test_expect_success "client & server log negotiated version (v${PROTO})" '
+               test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+               cp -r "$LOCAL_PRISTINE" local &&
+               GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
+               git -c protocol.version=$PROTO -C local fetch \
+                       --upload-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-upload-pack" \
+                       origin &&
+               test "$(grep \"key\":\"negotiated-version\",\"value\":\"$PROTO\" tr2-client-events)" &&
+               test "$(grep \"key\":\"negotiated-version\",\"value\":\"$PROTO\" tr2-server-events)"
+       '
 done
What are these `test` commands actually testing? Did you mean `test
-n`? Or, even better, just plain `grep` (not within a
command-substitution)?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help