Skip to content

Instantly share code, notes, and snippets.

View CognitiveDifference's full-sized avatar

CognitiveDifference

View GitHub Profile
@CognitiveDifference
CognitiveDifference / Makefile.version
Last active October 19, 2022 07:03 — forked from grihabor/Makefile.version
Makefile to use for incremental semantic versioning
# Source: https://gist.github.com/CognitiveDifference/466c32bf98c07dcd9719599ceed3ecdc
MAKE := make --no-print-directory
DESCRIBE := $(shell git describe --match "v*" --always --tags)
STATUS := $(shell git status --porcelain | grep " M ")
DESCRIBE_PARTS := $(subst -, ,$(DESCRIBE))
VERSION_TAG := $(word 1,$(DESCRIBE_PARTS))
COMMITS_SINCE_TAG := $(word 2,$(DESCRIBE_PARTS))