Skip to content
Snippets Groups Projects
Commit 999df612 authored by Yuriy Vostrikov's avatar Yuriy Vostrikov
Browse files

[core] Make version look like 'X.Y.Z +NNcommits sha1abbr'.

parent 965d1ab4
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
echo -n 'const char tarantool_version_string[] = "'
git tag | tail -n 1 | tr -d \\n
echo -n " +"$(git log --oneline $(git tag | tail -n1)..HEAD | wc -l)"commits "
git log -1 --format='%h' | tr -d \\n
git diff --quiet || (echo -n ' AND'; git diff --shortstat) | tr -d \\n
echo '";'
......@@ -99,10 +99,7 @@ endif
ifeq ($(HAVE_GIT),1)
tarantool_version.h: FORCE
@echo -n "const char tarantool_version_string[] = " > $@_
@git show HEAD | sed 's/commit \(.*\)/\"\1/;q' | tr -d \\n >> $@_
@git diff --quiet || (echo -n ' AND'; git diff --shortstat) | tr -d \\n >> $@_
@echo '";' >> $@_
@$(SRCDIR)/scripts/make_version.sh > $@_
@diff -q $@ $@_ 2>/dev/null >/dev/null || ($(ECHO) " GEN " $(notdir $@); cp $@_ $@)
FORCE:
endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment