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 <[email protected]>
---
 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
[email protected]

Reply via email to