mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC PATCH] setlocalversion: Also match non-annotated tags
@ 2018-09-06  8:39 Alexander Dahl
  2018-09-07 10:01 ` Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Dahl @ 2018-09-06  8:39 UTC (permalink / raw)
  To: ptxdist

From the Git manual:

       --tags
           Instead of using only the annotated tags, use any tag found
           in refs/tags namespace. This option enables matching a
           lightweight (non-annotated) tag.

This fixes the case for PTXDIST_BSP_AUTOVERSION returning things like
????.??.?-?-gcb7418a2299c-dirty when the last tag in the BSP was only a
lightweight one, no annotated tag.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 scripts/kernel/setlocalversion | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel/setlocalversion b/scripts/kernel/setlocalversion
index 3feb87dce..fd852cb26 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 --tags --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 --tags 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.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2018-09-07 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  8:39 [ptxdist] [RFC PATCH] setlocalversion: Also match non-annotated tags Alexander Dahl
2018-09-07 10:01 ` Michael Olbrich
2018-09-07 10:11   ` Alexander Dahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox