mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] setlocalversion: detect unannotated tags
@ 2010-07-01  7:49 Baruch Siach
  2010-07-01 12:00 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Baruch Siach @ 2010-07-01  7:49 UTC (permalink / raw)
  To: barebox

'git describe' shows:

v2009.12.0-178-gdc882c3

I.e. git doesn't find the more recent v2010.06.0 unannotated tag. The top-level
Makefile then takes the '-178-gdc882c3' part and attaches it to '2010.06.0'
(the current version string), making the output of the 'version' command:

barebox 2010.06.0-00178-gcc827a1 (Jul  1 2010 - 09:02:45)

which is plain wrong. Add the --tags option to make 'git describe' look for
unannotated tags as well.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 scripts/setlocalversion |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 83b7512..4f9dafe 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -12,7 +12,7 @@ cd "${1:-.}" || usage
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	# Do we have an untagged version?
 	if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
-		if tag=`git describe 2>/dev/null`; then
+		if tag=`git describe --tags 2>/dev/null`; then
 			echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
 		fi
 	fi
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] setlocalversion: detect unannotated tags
  2010-07-01  7:49 [PATCH] setlocalversion: detect unannotated tags Baruch Siach
@ 2010-07-01 12:00 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2010-07-01 12:00 UTC (permalink / raw)
  To: Baruch Siach; +Cc: barebox

On Thu, Jul 01, 2010 at 10:49:02AM +0300, Baruch Siach wrote:
> 'git describe' shows:
> 
> v2009.12.0-178-gdc882c3
> 
> I.e. git doesn't find the more recent v2010.06.0 unannotated tag. The top-level
> Makefile then takes the '-178-gdc882c3' part and attaches it to '2010.06.0'
> (the current version string), making the output of the 'version' command:
> 
> barebox 2010.06.0-00178-gcc827a1 (Jul  1 2010 - 09:02:45)
> 
> which is plain wrong. Add the --tags option to make 'git describe' look for
> unannotated tags as well.

I was never aware of this. Playing a bit with the Linux Kernel I
realized that when I have some arbitrary branch and create an annotated
tag on it the kernel reports 'linux-2.6.xx' without any suffixes which
is even more wrong.

So when we are using lightweight tags here we even increase the chance
that this happens.

I will create annotated tags in future anyway, so I think we can drop
this patch.

Sascha


> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  scripts/setlocalversion |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/setlocalversion b/scripts/setlocalversion
> index 83b7512..4f9dafe 100755
> --- a/scripts/setlocalversion
> +++ b/scripts/setlocalversion
> @@ -12,7 +12,7 @@ cd "${1:-.}" || usage
>  if head=`git rev-parse --verify HEAD 2>/dev/null`; then
>  	# Do we have an untagged version?
>  	if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
> -		if tag=`git describe 2>/dev/null`; then
> +		if tag=`git describe --tags 2>/dev/null`; then
>  			echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
>  		fi
>  	fi
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2010-07-01 12:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-01  7:49 [PATCH] setlocalversion: detect unannotated tags Baruch Siach
2010-07-01 12:00 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox