summaryrefslogtreecommitdiff
path: root/builtin/send-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-08-03 12:19:16 -0400
committerJunio C Hamano <gitster@pobox.com>2012-08-03 13:03:34 -0700
commitff5effdf455bd6e694ff0bb3e0793515a2214adb (patch)
tree944be26b5dd70882b10b587fd4e3a5a4bb0faa63 /builtin/send-pack.c
parent745c7c8e6252ba41430a1442e1fa8da2ec40e9c2 (diff)
downloadgit-ff5effdf455bd6e694ff0bb3e0793515a2214adb.tar.gz
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/send-pack.c')
-rw-r--r--builtin/send-pack.c7
1 files changed, 5 insertions, 2 deletions
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=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]\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",