From The Compiler, 5 Years ago, written in Plain Text.
Embed
  1. ╭─[florian@lupin]──[~]──[13-06-18]──[23:36]────┄
  2. ╰─╼ cat 0001-Add-git-version-info-to-version.mk-and-hc-version.patch
  3. From 383e9d9f9559eb3642e1eedfbfa5a1a0937992bb Mon Sep 17 00:00:00 2001
  4. From: Florian Bruhin <git@the-compiler.org>
  5. Date: Mon, 17 Jun 2013 23:24:27 +0200
  6. Subject: [PATCH] Add git version info to version.mk and "hc version"
  7.  
  8. ---
  9.  version.mk | 8 +++++++-
  10.  1 file changed, 7 insertions(+), 1 deletion(-)
  11.  
  12. diff --git a/version.mk b/version.mk
  13. index 5ebd85e..ede426f 100644
  14. --- a/version.mk
  15. +++ b/version.mk
  16. @@ -4,5 +4,11 @@ VERSION_MAJOR = 0
  17.  VERSION_MINOR = 5
  18.  # patch level
  19.  VERSION_PATCH = 1
  20. +# git version    
  21. +ifneq (,$(wildcard .git))
  22. +ifneq (,$(shell which git 2>/dev/null))
  23. +VERSION_GIT = \ \($(shell git rev-parse --short HEAD)\)
  24. +endif
  25. +endif
  26.  VERSION_SUFFIX = ""
  27. -VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX)
  28. +VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX)$(VERSION_GIT)
  29. --
  30. 1.8.3.1
  31.  
  32. ╭─[florian@lupin]──[~]──[13-06-18]──[23:36]────┄
  33. ╰─╼ curl -d lang=diff --data-urlencode text@0001-Add-git-version-info-to-version.mk-and-hc-version.patch http://paste.the-compiler.org/api/create
  34. <?xml version="1.0" encoding="iso-8859-1"?>
  35. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  36.          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  37. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  38.  <head>
  39.   <title>417 - Expectation Failed</title>
  40.  </head>
  41.  <body>
  42.   <h1>417 - Expectation Failed</h1>
  43.  </body>
  44. </html>