qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] scripts/qemu-version.sh: Always describe tag version
@ 2020-09-24 16:35 Philippe Mathieu-Daudé
  2020-10-05 17:01 ` 罗勇刚(Yonggang Luo)
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-24 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, 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

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 scripts/qemu-version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh
index 03128c56a2c..a7135511588 100755
--- a/scripts/qemu-version.sh
+++ b/scripts/qemu-version.sh
@@ -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
 
-- 
2.26.2



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

* Re: [RFC PATCH] scripts/qemu-version.sh: Always describe tag version
  2020-09-24 16:35 [RFC PATCH] scripts/qemu-version.sh: Always describe tag version Philippe Mathieu-Daudé
@ 2020-10-05 17:01 ` 罗勇刚(Yonggang Luo)
  0 siblings, 0 replies; 2+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-10-05 17:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Paolo Bonzini, qemu-level

[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]

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?


On Fri, Sep 25, 2020 at 12:50 AM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:
>
> 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
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  scripts/qemu-version.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh
> index 03128c56a2c..a7135511588 100755
> --- a/scripts/qemu-version.sh
> +++ b/scripts/qemu-version.sh
> @@ -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
>
> --
> 2.26.2
>
>


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

[-- Attachment #2: Type: text/html, Size: 2492 bytes --]

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

end of thread, other threads:[~2020-10-05 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24 16:35 [RFC PATCH] scripts/qemu-version.sh: Always describe tag version Philippe Mathieu-Daudé
2020-10-05 17:01 ` 罗勇刚(Yonggang Luo)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).