[Fedora-spins] [spin-kickstarts] Use git version to get version name

Bruno Wolff III bruno at fedoraproject.org
Fri Oct 18 20:14:07 UTC 2013


commit 1bdc87189a2069923c1040508caa9b92d169e64e
Author: Bruno Wolff III <bruno at wolff.to>
Date:   Fri Oct 18 15:10:14 2013 -0500

    Use git version to get version name
    
    Using git version is simpler as it handles oddball cases internally.
    Since we have been using mostly lightweight tags I have set it to
    search those in addition to annotated tags for the best match. The
    output for commits that don't have a tag seems a bit nicer as well.

 Makefile |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/Makefile b/Makefile
index 853b317..c1f57d1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,5 @@
-# Get the version name first by seeing if HEAD is tagged
-version := $(shell git tag --points-at HEAD -l '0.*.*' | sort -r | head -1)
-# And if it wasn't use a git hash
-ifeq ($(version),)
-  version := $(shell git log -1 --abbrev=8 --pretty=git%h)
-endif
+# Get a version name based off the nearest tag (include lightweight tags)
+version := $(shell git describe --tags)
 
 DESTDIR := /usr
 


More information about the spins mailing list