Skip to contentSkip to conversation

- Add GIT Version number

PATCH In review Sean 1 participant 1 message Jun 15, 2016 Kbuild

lore
Share & tools
lore

Sean

author
#0 lore raw

PATCH 1/3 - Add GIT Version number

Add a version number to the GIT Makefile; lifted from the Linux kernel source. Once set, the version number will be reported by the "--version" option on git commands that are converted to argp argument processing.

The version number was arbitrarily set to 0.5.0 as a starting point, but obviously you can change it as you see fit.

Makefile (mode:100644) +9 -1
Index: Makefile
===================================================================
@@ -7,8 +7,16 @@
 # BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
 # break unless your underlying filesystem supports those sub-second times
 # (my ext3 doesn't).
+#
+VERSION = 0
+PATCHLEVEL = 5
+SUBLEVEL = 0
+EXTRAVERSION =
+
+RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+
 COPTS=-O2
-CFLAGS=-g $(COPTS) -Wall
+CFLAGS=-g $(COPTS) -Wall '-DVERSION="$(RELEASE)"'
 
 prefix=$(HOME)
 bin=$(prefix)/bin