mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [RFC PATCH] setlocalversion: Also match non-annotated tags
Date: Fri, 7 Sep 2018 12:01:05 +0200	[thread overview]
Message-ID: <20180907100105.nleg2qmttyahcmzm@pengutronix.de> (raw)
In-Reply-To: <20180906083927.526-1-ada@thorsis.com>

On Thu, Sep 06, 2018 at 10:39:27AM +0200, Alexander Dahl wrote:
> 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.

Nack. Using only annotated tags is a deliberate choice we made. Changing
this would break all kinds of existing use-cases.

I think it would be ok to make this optional (opt-in) in the script. And
then define a custom ptxd_bsp_autoversion() in your BSP to enable this.

Michael

> 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

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2018-09-07 10:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  8:39 Alexander Dahl
2018-09-07 10:01 ` Michael Olbrich [this message]
2018-09-07 10:11   ` Alexander Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180907100105.nleg2qmttyahcmzm@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox