From 11fd0c422b627d73d563916c6f559d3c0a021f26 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 8 Nov 2010 16:26:02 +0100 Subject: [PATCH] now redis-cli is able to show the Git SHA1 in the version output --- src/Makefile | 2 +- src/redis-cli.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 51ac2d47..ac0db577 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,7 +26,7 @@ INSTALL= cp -p OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o vm.o pubsub.o multi.o debug.o sort.o intset.o syncio.o BENCHOBJ = ae.o anet.o redis-benchmark.o sds.o adlist.o zmalloc.o -CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o +CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o release.o CHECKDUMPOBJ = redis-check-dump.o lzf_c.o lzf_d.o CHECKAOFOBJ = redis-check-aof.o diff --git a/src/redis-cli.c b/src/redis-cli.c index 450c6d58..eef5ad1e 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -67,6 +67,7 @@ static struct config { } config; static void usage(); +char *redisGitSHA1(void); /*------------------------------------------------------------------------------ * Utility functions @@ -351,7 +352,7 @@ static int parseOptions(int argc, char **argv) { "automatically used as last argument.\n" ); } else if (!strcmp(argv[i],"-v")) { - printf("redis-cli shipped with Redis version %s\n", REDIS_VERSION); + printf("redis-cli shipped with Redis version %s (%s)\n", REDIS_VERSION, redisGitSHA1()); exit(0); } else { break; -- 2.45.2