From ff5effdf455bd6e694ff0bb3e0793515a2214adb Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 3 Aug 2012 12:19:16 -0400 Subject: include agent identifier in capability string Instead of having the client advertise a particular version number in the git protocol, we have managed extensions and backwards compatibility by having clients and servers advertise capabilities that they support. This is far more robust than having each side consult a table of known versions, and provides sufficient information for the protocol interaction to complete. However, it does not allow servers to keep statistics on which client versions are being used. This information is not necessary to complete the network request (the capabilities provide enough information for that), but it may be helpful to conduct a general survey of client versions in use. We already send the client version in the user-agent header for http requests; adding it here allows us to gather similar statistics for non-http requests. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/send-pack.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'builtin/send-pack.c') diff --git a/builtin/send-pack.c b/builtin/send-pack.c index d5d7105ba2..c4d42113c2 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -8,6 +8,7 @@ #include "send-pack.h" #include "quote.h" #include "transport.h" +#include "version.h" static const char send_pack_usage[] = "git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=] [--verbose] [--thin] [:] [...]\n" @@ -306,11 +307,13 @@ int send_pack(struct send_pack_args *args, int quiet = quiet_supported && (args->quiet || !args->progress); if (!cmds_sent && (status_report || use_sideband || args->quiet)) { - packet_buf_write(&req_buf, "%s %s %s%c%s%s%s", + packet_buf_write(&req_buf, + "%s %s %s%c%s%s%s agent=%s", old_hex, new_hex, ref->name, 0, status_report ? " report-status" : "", use_sideband ? " side-band-64k" : "", - quiet ? " quiet" : ""); + quiet ? " quiet" : "", + git_user_agent_sanitized()); } else packet_buf_write(&req_buf, "%s %s %s", -- cgit v1.2.3