mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
@ 2018-12-12  9:14 Denis OSTERLAND
  2018-12-12  9:47 ` Alexander Dahl
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Denis OSTERLAND @ 2018-12-12  9:14 UTC (permalink / raw)
  To: ptxdist

Consider following situation:

                           tag C
                             v
                     A---B---C topic
                    /         \
               D---E---F---G---H master
                   ^
                 tag E

PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
but at commit H it will be C-3-gXXXX.
With --first-parent it will be E-3-gXXXX.
This is more intuitive result,
especially when more than just one branch gets merged.

Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
---
 scripts/kernel/setlocalversion | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel/setlocalversion b/scripts/kernel/setlocalversion
index 3feb87dce..7eaaaf413 100755
--- a/scripts/kernel/setlocalversion
+++ b/scripts/kernel/setlocalversion
@@ -55,12 +55,12 @@ if head=`git ${git_abbrev} rev-parse --verify --short HEAD 2>/dev/null`; then
 
 	# If we are at a tagged commit (like "ptxdist-2010.05.0"), we
 	# print it here
-	if atag="`git describe --exact-match 2>/dev/null`"; then
+	if atag="`git describe --first-parent --exact-match 2>/dev/null`"; then
 		echo "$atag" | awk -F- '{printf("%s", $(NF))}'
 
 	# If we are past a tagged commit (like "ptxdist-2010.03.0-130-g3c60777"),
 	# we pretty print it.
-	elif atag="`git ${git_abbrev} describe 2>/dev/null`"; then
+	elif atag="`git ${git_abbrev} describe --first-parent 2>/dev/null`"; then
 		echo "$atag" | awk -F- '{printf("%s-%05d-%s", $(NF-2),$(NF-1),$(NF))}'
 
 	# If we don't have a tag at all we print ????.??.?-?-g{commitish}.
-- 
2.19.2



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-12-13  9:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-12  9:14 [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox