From 816fb46be665c8b63647f0096845fef363736b20 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 2 Jun 2012 14:51:42 -0400 Subject: move git_version_string into version.c The global git_version_string currently lives in git.c, but doesn't have anything to do with the git wrapper. Let's move it into its own file, where it will be more appropriate to build more version-related functions. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- version.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 version.h (limited to 'version.h') diff --git a/version.h b/version.h new file mode 100644 index 0000000000..8d6c413398 --- /dev/null +++ b/version.h @@ -0,0 +1,6 @@ +#ifndef VERSION_H +#define VERSION_H + +extern const char git_version_string[]; + +#endif /* VERSION_H */ -- cgit v1.2.1 From 42dcbb738b47ab7e2b265ed981c9a4a7bda92f97 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 2 Jun 2012 15:01:12 -0400 Subject: version: add git_user_agent function This is basically a fancy way of saying "git/$GIT_VERSION", except that it is overridable at build-time and through the environment. Which means that people who don't want to advertise their git version (for privacy or security reasons) can tweak it. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- version.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'version.h') diff --git a/version.h b/version.h index 8d6c413398..fd9cdd6316 100644 --- a/version.h +++ b/version.h @@ -3,4 +3,6 @@ extern const char git_version_string[]; +const char *git_user_agent(void); + #endif /* VERSION_H */ -- cgit v1.2.1 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 --- version.h | 1 + 1 file changed, 1 insertion(+) (limited to 'version.h') diff --git a/version.h b/version.h index fd9cdd6316..6911a4f155 100644 --- a/version.h +++ b/version.h @@ -4,5 +4,6 @@ extern const char git_version_string[]; const char *git_user_agent(void); +const char *git_user_agent_sanitized(void); #endif /* VERSION_H */ -- cgit v1.2.1