From 8dfdb7e29912d239542c40e581660331059179a3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 29 Aug 2016 11:25:56 -0700 Subject: [PATCH 1/2] Specify the "g" in gRPC --- build.yaml | 1 + include/grpc/grpc.h | 3 +++ src/core/lib/channel/http_client_filter.c | 5 +++-- src/core/lib/surface/version.c | 2 ++ templates/src/core/lib/surface/version.c.template | 8 +++++--- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build.yaml b/build.yaml index 506a02920c1..7017f5c99b7 100644 --- a/build.yaml +++ b/build.yaml @@ -7,6 +7,7 @@ settings: '#3': Use "-preN" suffixes to identify pre-release versions '#4': Per-language overrides are possible with (eg) ruby_version tag here '#5': See the expand_version.py for all the quirks here + g_stands_for: good version: 1.1.0-dev filegroups: - name: census diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 4ca018edb39..587d86c98fd 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -90,6 +90,9 @@ GRPCAPI void grpc_shutdown(void); /** Return a string representing the current version of grpc */ GRPCAPI const char *grpc_version_string(void); +/** Return a string specifying what the 'g' in gRPC stands for */ +GRPCAPI const char *grpc_g_stands_for(void); + /** Create a completion queue */ GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved); diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c index a7a775cc533..9e67df8a9cf 100644 --- a/src/core/lib/channel/http_client_filter.c +++ b/src/core/lib/channel/http_client_filter.c @@ -233,8 +233,9 @@ static grpc_mdstr *user_agent_from_args(const grpc_channel_args *args, } } - gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s)", is_first ? "" : " ", - grpc_version_string(), GPR_PLATFORM_STRING, transport_name); + gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s; %s)", is_first ? "" : " ", + grpc_version_string(), GPR_PLATFORM_STRING, transport_name, + grpc_g_stands_for()); is_first = 0; gpr_strvec_add(&v, tmp); diff --git a/src/core/lib/surface/version.c b/src/core/lib/surface/version.c index 19420750545..41242684da5 100644 --- a/src/core/lib/surface/version.c +++ b/src/core/lib/surface/version.c @@ -37,3 +37,5 @@ #include const char *grpc_version_string(void) { return "1.1.0-dev"; } + +const char *grpc_g_stands_for(void) { return "good"; } diff --git a/templates/src/core/lib/surface/version.c.template b/templates/src/core/lib/surface/version.c.template index 5f0273e49df..12c490e6a9d 100644 --- a/templates/src/core/lib/surface/version.c.template +++ b/templates/src/core/lib/surface/version.c.template @@ -32,10 +32,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - + /* This file is autogenerated from: templates/src/core/surface/version.c.template */ - + #include - + const char *grpc_version_string(void) { return "${settings.core_version}"; } + + const char *grpc_g_stands_for(void) { return "${settings.g_stands_for}"; } From d9f907671d9ea702252615d98547f91d885840aa Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 29 Aug 2016 16:47:22 -0700 Subject: [PATCH 2/2] Update documentation --- build.yaml | 15 ++++++++++----- doc/g_stands_for.md | 8 ++++++++ grpc.def | 1 + src/ruby/ext/grpc/rb_grpc_imports.generated.c | 2 ++ src/ruby/ext/grpc/rb_grpc_imports.generated.h | 3 +++ 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 doc/g_stands_for.md diff --git a/build.yaml b/build.yaml index 7017f5c99b7..7ac7f2065f6 100644 --- a/build.yaml +++ b/build.yaml @@ -2,11 +2,16 @@ '#2': It is used among other things to generate all of our project files. '#3': Please refer to the templates directory for more information. settings: - '#1': The public version number of the library. - '#2': Master always has a "-dev" suffix - '#3': Use "-preN" suffixes to identify pre-release versions - '#4': Per-language overrides are possible with (eg) ruby_version tag here - '#5': See the expand_version.py for all the quirks here + '#01': The public version number of the library. + '#02': === + '#03': Please update the 'g_stands_for' field periodically with a new g word + '#04': not listed in doc/g_stands_for.md - and update that document to list the + '#05': new word. + '#06': === + '#07': Master always has a "-dev" suffix + '#08': Use "-preN" suffixes to identify pre-release versions + '#09': Per-language overrides are possible with (eg) ruby_version tag here + '#10': See the expand_version.py for all the quirks here g_stands_for: good version: 1.1.0-dev filegroups: diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md new file mode 100644 index 00000000000..52f8eae05aa --- /dev/null +++ b/doc/g_stands_for.md @@ -0,0 +1,8 @@ +Each version of gRPC gets a new description of what the 'g' stands for, since +we've never really been able to figure it out. + +Below is a list of already-used definitions (that should not be repeated in the +future), and the corresponding version numbers that used them: + +- 1.0 'g' stands for 'gRPC' +- 1.1 'g' stands for 'good' diff --git a/grpc.def b/grpc.def index e2255df7388..d6ddd33a926 100644 --- a/grpc.def +++ b/grpc.def @@ -42,6 +42,7 @@ EXPORTS grpc_init grpc_shutdown grpc_version_string + grpc_g_stands_for grpc_completion_queue_create grpc_completion_queue_next grpc_completion_queue_pluck diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index aee57b11aa1..9caaf7b7835 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -80,6 +80,7 @@ grpc_register_plugin_type grpc_register_plugin_import; grpc_init_type grpc_init_import; grpc_shutdown_type grpc_shutdown_import; grpc_version_string_type grpc_version_string_import; +grpc_g_stands_for_type grpc_g_stands_for_import; grpc_completion_queue_create_type grpc_completion_queue_create_import; grpc_completion_queue_next_type grpc_completion_queue_next_import; grpc_completion_queue_pluck_type grpc_completion_queue_pluck_import; @@ -348,6 +349,7 @@ void grpc_rb_load_imports(HMODULE library) { grpc_init_import = (grpc_init_type) GetProcAddress(library, "grpc_init"); grpc_shutdown_import = (grpc_shutdown_type) GetProcAddress(library, "grpc_shutdown"); grpc_version_string_import = (grpc_version_string_type) GetProcAddress(library, "grpc_version_string"); + grpc_g_stands_for_import = (grpc_g_stands_for_type) GetProcAddress(library, "grpc_g_stands_for"); grpc_completion_queue_create_import = (grpc_completion_queue_create_type) GetProcAddress(library, "grpc_completion_queue_create"); grpc_completion_queue_next_import = (grpc_completion_queue_next_type) GetProcAddress(library, "grpc_completion_queue_next"); grpc_completion_queue_pluck_import = (grpc_completion_queue_pluck_type) GetProcAddress(library, "grpc_completion_queue_pluck"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 3bb76fbb97e..a2f5b86497b 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -191,6 +191,9 @@ extern grpc_shutdown_type grpc_shutdown_import; typedef const char *(*grpc_version_string_type)(void); extern grpc_version_string_type grpc_version_string_import; #define grpc_version_string grpc_version_string_import +typedef const char *(*grpc_g_stands_for_type)(void); +extern grpc_g_stands_for_type grpc_g_stands_for_import; +#define grpc_g_stands_for grpc_g_stands_for_import typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(void *reserved); extern grpc_completion_queue_create_type grpc_completion_queue_create_import; #define grpc_completion_queue_create grpc_completion_queue_create_import