Skip to contentSkip to conversation

scripts/qemu-version.sh: Always describe tag version

RFC PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Sep 24, 2020 – Oct 5, 2020

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 scripts/qemu-version.sh: Always describe tag version

I'm not sure why sometime I get this error:

  $ make
  Generating qemu-version.h with a meson_exe.py custom command
  fatal: No tags can describe 'dc9f825f99eb5dc82f127e6c95fbe3a503e11346'.
  Try --always, or create some tags.

While to --always option is not clear in GIT-DESCRIBE(1):

--always
Show uniquely abbreviated commit object as fallback.

using it works and fix my builds:

  $ git describe --match 'v*' --dirty --always
  dc9f825f99e-dirty
---
 scripts/qemu-version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qemu-version.sh +1 -1
index 03128c56a2c..a7135511588 100755
@@ -9,7 +9,7 @@ version="$3"
 if [ -z "$pkgversion" ]; then
     cd "$dir"
     if [ -e .git ]; then
-        pkgversion=$(git describe --match 'v*' --dirty | echo "")
+        pkgversion=$(git describe --match 'v*' --dirty --always | echo "")
     fi
 fi
 
Signature · 1 line
2.26.2
#1 lore raw

On windows executing
"pkgversion=$(git describe --match 'v*' --dirty --always | echo "")"

$ bash ./scripts/qemu-version.sh . '' ''
#define QEMU_PKGVERSION ""
#define QEMU_FULL_VERSION ""

The result are empty.

By removing echo ""

        pkgversion=$(git describe --match 'v*' --dirty --always)
the result are
```
$ bash ./scripts/qemu-version.sh . '' ''
#define QEMU_PKGVERSION "v5.1.0-1922-g94f35f943a-dirty"
#define QEMU_FULL_VERSION " (v5.1.0-1922-g94f35f943a-dirty)"
```

What are expected?

Quoted 28 lines · Philippe Mathieu-Daudé

I'm not sure why sometime I get this error:

  $ make
  Generating qemu-version.h with a meson_exe.py custom command
  fatal: No tags can describe 'dc9f825f99eb5dc82f127e6c95fbe3a503e11346'.
  Try --always, or create some tags.

While to --always option is not clear in GIT-DESCRIBE(1):

--always
Show uniquely abbreviated commit object as fallback.

using it works and fix my builds:

  $ git describe --match 'v*' --dirty --always
  dc9f825f99e-dirty
---
 scripts/qemu-version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qemu-version.sh +0 -0
index 03128c56a2c..a7135511588 100755

scripts/qemu-version.sh version="$3" · line 12

Quoted 5 lines
scripts/qemu-version.sh +1 -1
@@ -9,7 +9,7 @@ version="$3"
 if [ -z "$pkgversion" ]; then
     cd "$dir"
     if [ -e .git ]; then
-        pkgversion=$(git describe --match 'v*' --dirty | echo "")
+        pkgversion=$(git describe --match 'v*' --dirty --always | echo

"")

Quoted 7 lines
scripts/qemu-version.sh +0 -1
     fi
 fi
 
--

2.26.2

--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo