Skip to content

Commit

Permalink
Merge pull request grpc#7912 from ctiller/g_stands_for
Browse files Browse the repository at this point in the history
Specify the "g" in gRPC
  • Loading branch information
ctiller authored Aug 30, 2016
2 parents d76ea83 + d9f9076 commit 9909170
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 10 deletions.
16 changes: 11 additions & 5 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
'#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:
- name: census
Expand Down
8 changes: 8 additions & 0 deletions doc/g_stands_for.md
Original file line number Diff line number Diff line change
@@ -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'
1 change: 1 addition & 0 deletions grpc.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions include/grpc/grpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions src/core/lib/channel/http_client_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions src/core/lib/surface/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@
#include <grpc/grpc.h>

const char *grpc_version_string(void) { return "1.1.0-dev"; }

const char *grpc_g_stands_for(void) { return "good"; }
2 changes: 2 additions & 0 deletions src/ruby/ext/grpc/rb_grpc_imports.generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions src/ruby/ext/grpc/rb_grpc_imports.generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions templates/src/core/lib/surface/version.c.template
Original file line number Diff line number Diff line change
Expand Up @@ -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 <grpc/grpc.h>

const char *grpc_version_string(void) { return "${settings.core_version}"; }

const char *grpc_g_stands_for(void) { return "${settings.g_stands_for}"; }

0 comments on commit 9909170

Please sign in to comment.