From d720c6666dac60012a1e6fac7cfa77ca91066fae Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 21 Aug 2013 12:47:29 -0400 Subject: [PATCH] verstr separated into script so that it may be used by others --- Makefile | 4 +--- verstr | 10 ++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100755 verstr diff --git a/Makefile b/Makefile index 0f05c93..4c54203 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,7 @@ default: lvspec.pdf # outputs a version string to uniquely identify the document revision # TODO: use tag name if matches current commit verstr.tex: - git log -n1 --format=%h | tr -d '\n' > verstr.tex - test -z "$$( git status -s | grep -v '^?? ' )" \ - || echo -n '-dirty' >> verstr.tex + verstr >$@ clean: rm -f *.pdf diff --git a/verstr b/verstr new file mode 100755 index 0000000..08e6a02 --- /dev/null +++ b/verstr @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Generates version string + +# output current shortref +git log -n1 --format=%h | tr -d '\n' + +# if we have uncommitted changes, then append with -dirty +test -z "$$( git status -s | grep -v '^?? ' )" \ + || echo -n '-dirty'