mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Denis OSTERLAND <denis.osterland@diehl.com>
To: "ptxdist@pengutronix.de" <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
Date: Thu, 13 Dec 2018 09:37:42 +0000	[thread overview]
Message-ID: <1544693861.6129.17.camel@diehl.com> (raw)
In-Reply-To: <1544687815.6129.9.camel@diehl.com>

Hi,

for interested listeners, my custom auto-version with '-' handling.
It defers in format, but thats okay to me.

$ git describe
OSELAS.BSP-Pengutronix-Generic-2014.07.0-6-g3266e67

$ ./p print PTXDIST_BSP_AUTOVERSION
2014.07.0-00006-g3266e67f0b46

$ ./p print BSP_AUTOVERSION
2014.07.0-6-g3266e67

Regards Denis
---
 rules/pre/autoversion.make | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/rules/pre/autoversion.make b/rules/pre/autoversion.make
new file mode 100644
index 0000000..cceeb09
--- /dev/null
+++ b/rules/pre/autoversion.make
@@ -0,0 +1,17 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Denis Osterland <Denis.Osterland@diehl.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+AUTOVERSION_GIT_LAST_TAG := $(shell git describe --first-parent --abbrev=0)
+AUTOVERSION_GIT_DESCRIBE := $(shell git describe --first-parent --dirty)
+BSP_AUTOVERSION := $(addprefix \
+       $(lastword $(subst -, ,$(AUTOVERSION_GIT_LAST_TAG))), \
+       $(AUTOVERSION_GIT_DESCRIBE:$(AUTOVERSION_GIT_LAST_TAG)%=%))
+
+# vim: syntax=make

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2018-12-13  9:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12  9:14 Denis OSTERLAND
2018-12-12  9:47 ` Alexander Dahl
2018-12-12 13:51 ` Michael Olbrich
2018-12-12 14:35   ` Denis OSTERLAND
2018-12-12 14:53     ` Michael Olbrich
2018-12-12 15:32       ` Denis OSTERLAND
2018-12-13  7:29 ` Uwe Kleine-König
2018-12-13  7:56   ` Denis OSTERLAND
2018-12-13  9:37     ` Denis OSTERLAND [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1544693861.6129.17.camel@diehl.com \
    --to=denis.osterland@diehl.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox