On Mon, Nov 25, 2019 at 11:47:45AM +0300, Alexander Voropay wrote:
> A tiny patch for Urjtag's autoconfigure to use GIT "log" hash as a
> snapshot version. I hope it doesn't broke previous logic...
> Unfortunately 'git-svn-id' field is not used since 2017 ,

Most likely the day we switched completely to  git.

 
> The "SVN_REVISION" is used in the "src/apps/jtag/jtag.c" for
> banner as %s string and shouldn't be an integer so GIT hash works well.
> 
> Note
> 'REVISION = "0"' versus 'REVISION -eq "0"'
> since previous check returns emtpy string: ""
> and numeric comparison  " if test ... -eq"  fails.

> From 2a8169a2bc15a55dcd53d47d7b3f4b5b492bcaf1 Mon Sep 17 00:00:00 2001
> From: Alexander Voropay <a...@sensi.org>
> Date: Mon, 25 Nov 2019 10:51:35 +0300
> Subject: [PATCH] git log hash as version number
> 
> ---
>  urjtag/configure.ac | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/urjtag/configure.ac b/urjtag/configure.ac
> index c87b2385..7f348bb1 100644
> --- a/urjtag/configure.ac
> +++ b/urjtag/configure.ac
> @@ -47,7 +47,11 @@ if test "$SVN_REVISION" -eq 0; then
>      SVN_REVISION=`git log -n1 --pretty=format:%b 2>/dev/null | sed -n 
> '/^git-svn-id:/{s:.*@::;s: .*::;p}'`
>      SVN_FROM="git-svn log"
>  fi
> -if test "$SVN_REVISION" -eq "0" ; then
> +if test "$SVN_REVISION" = "0" -o -z "$SVN_REVISION"; then
> +    SVN_REVISION=`git log -n1 --pretty=format:%h 2>/dev/null`
> +    SVN_FROM="git log hash"
> +fi
> +if test "$SVN_REVISION" = "0" -o -z "$SVN_REVISION" ; then
>      AC_MSG_RESULT([unknown, using 0])
>  else
>      AC_MSG_RESULT([from $SVN_FROM: $SVN_REVISION])
> -- 
> 2.21.0

I do have questions about that patch. I feel not comfortable with it.
Applied.
Because I feel much less comfortable with the patch with in
email. Having it in git will prevent that it gets lost.


Groeten
Geert Stappers
-- 
Leven en laten leven


_______________________________________________
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to