mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
@ 2018-12-12  9:14 Denis OSTERLAND
  2018-12-12  9:47 ` Alexander Dahl
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Denis OSTERLAND @ 2018-12-12  9:14 UTC (permalink / raw)
  To: ptxdist

Consider following situation:

                           tag C
                             v
                     A---B---C topic
                    /         \
               D---E---F---G---H master
                   ^
                 tag E

PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
but at commit H it will be C-3-gXXXX.
With --first-parent it will be E-3-gXXXX.
This is more intuitive result,
especially when more than just one branch gets merged.

Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
---
 scripts/kernel/setlocalversion | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel/setlocalversion b/scripts/kernel/setlocalversion
index 3feb87dce..7eaaaf413 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 --first-parent --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 --first-parent 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.19.2



Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-12  9:14 [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch Denis OSTERLAND
@ 2018-12-12  9:47 ` Alexander Dahl
  2018-12-12 13:51 ` Michael Olbrich
  2018-12-13  7:29 ` Uwe Kleine-König
  2 siblings, 0 replies; 9+ messages in thread
From: Alexander Dahl @ 2018-12-12  9:47 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 568 bytes --]

Hei hei,

On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> This is more intuitive result,
> especially when more than just one branch gets merged.
> 
> Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>

Acked-by: Alexander Dahl <post@lespocky.de>

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN     | speech censured, the first thought forbidden, the
 X  AGAINST      | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-12  9:14 [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch Denis OSTERLAND
  2018-12-12  9:47 ` Alexander Dahl
@ 2018-12-12 13:51 ` Michael Olbrich
  2018-12-12 14:35   ` Denis OSTERLAND
  2018-12-13  7:29 ` Uwe Kleine-König
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2018-12-12 13:51 UTC (permalink / raw)
  To: ptxdist

On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> Consider following situation:
> 
>                            tag C
>                              v
>                      A---B---C topic
>                     /         \
>                D---E---F---G---H master
>                    ^
>                  tag E
> 
> PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
> but at commit H it will be C-3-gXXXX.
> With --first-parent it will be E-3-gXXXX.
> This is more intuitive result,
> especially when more than just one branch gets merged.

Nack. This only works with explicit merges. If multiple people update the
branch with git pull/push, then the first parent may not be the upstream
commit and the correct tag may be missed.

In your example above consider 'C' the HEAD of the local master branch
before a pull/push. Then the first parent of 'H' is 'C'. And a if 'F' is
the tag, then it is ignored.

Maybe a patch that allows to overwrite setlocalversion in the BSP?

Michael

> Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
> ---
>  scripts/kernel/setlocalversion | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/kernel/setlocalversion b/scripts/kernel/setlocalversion
> index 3feb87dce..7eaaaf413 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 --first-parent --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 --first-parent 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.19.2
> 
> 
> 
> Diehl Connectivity Solutions GmbH
> Geschäftsführung: Horst Leonberger
> Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
> Nürnberg: HRB 32315
> ___________________________________________________________________________________________________
> 
> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
> Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
> The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
> mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
> 
> _______________________________________________
> 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

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-12 13:51 ` Michael Olbrich
@ 2018-12-12 14:35   ` Denis OSTERLAND
  2018-12-12 14:53     ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Denis OSTERLAND @ 2018-12-12 14:35 UTC (permalink / raw)
  To: ptxdist

Hi,

Am Mittwoch, den 12.12.2018, 14:51 +0100 schrieb Michael Olbrich:
> On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> > 
> > Consider following situation:
> > 
> >                            tag C
> >                              v
> >                      A---B---C topic
> >                     /         \
> >                D---E---F---G---H master
> >                    ^
> >                  tag E
> > 
> > PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
> > but at commit H it will be C-3-gXXXX.
> > With --first-parent it will be E-3-gXXXX.
> > This is more intuitive result,
> > especially when more than just one branch gets merged.
> Nack. This only works with explicit merges. If multiple people update the
> branch with git pull/push, then the first parent may not be the upstream
> commit and the correct tag may be missed.
I am not sure if I got the point here.

Is this your concern:
                           tag C
                             v
                     A---B---C origin/master
                    /         \
               D---E---F---G---H master

and now when pushing master to origin C becomes invisible.

> 
> In your example above consider 'C' the HEAD of the local master branch
> before a pull/push. Then the first parent of 'H' is 'C'. And a if 'F' is
> the tag, then it is ignored.
The branches are equal, so of course yes.

If I got you right:

              tag C
                v
        A---B---C---H topic
       /           /
  D---E---F-------G master
          ^
        tag F

At G it is F-1-gXXXX.
At H it is C-3-gXXXX and C-1-gXXXX with --first-parent.

Seems to be correct behavior to me.

> 
> Maybe a patch that allows to overwrite setlocalversion in the BSP?
> 
> Michael

Regards Denis

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-12 14:35   ` Denis OSTERLAND
@ 2018-12-12 14:53     ` Michael Olbrich
  2018-12-12 15:32       ` Denis OSTERLAND
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2018-12-12 14:53 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Dec 12, 2018 at 02:35:45PM +0000, Denis OSTERLAND wrote:
> Am Mittwoch, den 12.12.2018, 14:51 +0100 schrieb Michael Olbrich:
> > On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> > > 
> > > Consider following situation:
> > > 
> > >                            tag C
> > >                              v
> > >                      A---B---C topic
> > >                     /         \
> > >                D---E---F---G---H master
> > >                    ^
> > >                  tag E
> > > 
> > > PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
> > > but at commit H it will be C-3-gXXXX.
> > > With --first-parent it will be E-3-gXXXX.
> > > This is more intuitive result,
> > > especially when more than just one branch gets merged.
> > Nack. This only works with explicit merges. If multiple people update the
> > branch with git pull/push, then the first parent may not be the upstream
> > commit and the correct tag may be missed.
> I am not sure if I got the point here.
> 
> Is this your concern:
>                            tag C
>                              v
>                      A---B---C origin/master
>                     /         \
>                D---E---F---G---H master
> 
> and now when pushing master to origin C becomes invisible.

Exactly, and that is not acceptable in general.

> > In your example above consider 'C' the HEAD of the local master branch
> > before a pull/push. Then the first parent of 'H' is 'C'. And a if 'F' is
> > the tag, then it is ignored.
> The branches are equal, so of course yes.
> 
> If I got you right:
> 
>               tag C
>                 v
>         A---B---C---H topic
>        /           /
>   D---E---F-------G master
>           ^
>         tag F
> 
> At G it is F-1-gXXXX.
> At H it is C-3-gXXXX and C-1-gXXXX with --first-parent.
> 
> Seems to be correct behavior to me.

I'm not sure what your point is here.

Michael

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

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-12 14:53     ` Michael Olbrich
@ 2018-12-12 15:32       ` Denis OSTERLAND
  0 siblings, 0 replies; 9+ messages in thread
From: Denis OSTERLAND @ 2018-12-12 15:32 UTC (permalink / raw)
  To: ptxdist

Hi,

Am Mittwoch, den 12.12.2018, 15:53 +0100 schrieb Michael Olbrich:
> Hi,
> 
> On Wed, Dec 12, 2018 at 02:35:45PM +0000, Denis OSTERLAND wrote:
> > 
> > Am Mittwoch, den 12.12.2018, 14:51 +0100 schrieb Michael Olbrich:
> > > 
> > > On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> > > > 
> > > > 
> > > > Consider following situation:
> > > > 
> > > >                            tag C
> > > >                              v
> > > >                      A---B---C topic
> > > >                     /         \
> > > >                D---E---F---G---H master
> > > >                    ^
> > > >                  tag E
> > > > 
> > > > PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
> > > > but at commit H it will be C-3-gXXXX.
> > > > With --first-parent it will be E-3-gXXXX.
> > > > This is more intuitive result,
> > > > especially when more than just one branch gets merged.
> > > Nack. This only works with explicit merges. If multiple people update the
> > > branch with git pull/push, then the first parent may not be the upstream
> > > commit and the correct tag may be missed.
> > I am not sure if I got the point here.
> > 
> > Is this your concern:
> >                            tag C
> >                              v
> >                      A---B---C origin/master
> >                     /         \
> >                D---E---F---G---H master
> > 
> > and now when pushing master to origin C becomes invisible.
> Exactly, and that is not acceptable in general.
Okay.
We do "git rebase origin/master" before push, but in general you are right this is possible.

> 
> > 
> > > 
> > > In your example above consider 'C' the HEAD of the local master branch
> > > before a pull/push. Then the first parent of 'H' is 'C'. And a if 'F' is
> > > the tag, then it is ignored.
> > The branches are equal, so of course yes.
> > 
> > If I got you right:
> > 
> >               tag C
> >                 v
> >         A---B---C---H topic
> >        /           /
> >   D---E---F-------G master
> >           ^
> >         tag F
> > 
> > At G it is F-1-gXXXX.
> > At H it is C-3-gXXXX and C-1-gXXXX with --first-parent.
> > 
> > Seems to be correct behavior to me.
> I'm not sure what your point is here.
I guess I got you wrong here. Your paragraph also applies to above example.

> 
> Michael
> 

I found a simple to do it in my BSP:

diff --git a/configs/ptxconfig b/configs/ptxconfig
index f59c6ea..15ce835 100644
--- a/configs/ptxconfig
+++ b/configs/ptxconfig
@@ -61,7 +61,7 @@ PTXCONF_WEBUI=y
 #
 PTXCONF_PROJECT_VENDOR="Diehl Connectivity Solutions GmbH"
 PTXCONF_PROJECT="Jelica"
-PTXCONF_PROJECT_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
+PTXCONF_PROJECT_VERSION="-${BSP_AUTOVERSION}"
 
 #
 # ------------------------------------
diff --git a/rules/autoversion.make b/rules/autoversion.make
new file mode 100644
index 0000000..971f762
--- /dev/null
+++ b/rules/autoversion.make
@@ -0,0 +1,13 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Denis Osterland <Denis.Osterland@diehl.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+BSP_AUTOVERSION=$(shell git describe --first-parent --dirty)
+
+# vim: syntax=make

Regards Denis

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-12  9:14 [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch Denis OSTERLAND
  2018-12-12  9:47 ` Alexander Dahl
  2018-12-12 13:51 ` Michael Olbrich
@ 2018-12-13  7:29 ` Uwe Kleine-König
  2018-12-13  7:56   ` Denis OSTERLAND
  2 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2018-12-13  7:29 UTC (permalink / raw)
  To: ptxdist

On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> Consider following situation:
> 
>                            tag C
>                              v
>                      A---B---C topic
>                     /         \
>                D---E---F---G---H master
>                    ^
>                  tag E
> 
> PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
> but at commit H it will be C-3-gXXXX.

At H I'd expect C-1-gXXXX.

I think in general using --first-parent is wrong. It's only in some
workflows (i.e. when there is a single person that does "mainline
merges") where the first parent is special.

> With --first-parent it will be E-3-gXXXX.
> This is more intuitive result,
> especially when more than just one branch gets merged.
> 
> Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
> ---
>  scripts/kernel/setlocalversion | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/kernel/setlocalversion b/scripts/kernel/setlocalversion
> index 3feb87dce..7eaaaf413 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 --first-parent --exact-match 2>/dev/null`"; then

With --exact-match --first-parent is a noop, isn't it?

>  		echo "$atag" | awk -F- '{printf("%s", $(NF))}'

unrelated to this patch: if atag is "ELWMS-1.0-rc17" the result here is
"rc17", isn't it?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-13  7:29 ` Uwe Kleine-König
@ 2018-12-13  7:56   ` Denis OSTERLAND
  2018-12-13  9:37     ` Denis OSTERLAND
  0 siblings, 1 reply; 9+ messages in thread
From: Denis OSTERLAND @ 2018-12-13  7:56 UTC (permalink / raw)
  To: ptxdist

Hi

Am Donnerstag, den 13.12.2018, 08:29 +0100 schrieb Uwe Kleine-König:
> On Wed, Dec 12, 2018 at 09:14:52AM +0000, Denis OSTERLAND wrote:
> > 
> > Consider following situation:
> > 
> >                            tag C
> >                              v
> >                      A---B---C topic
> >                     /         \
> >                D---E---F---G---H master
> >                    ^
> >                  tag E
> > 
> > PTXDIST_BSP_AUTOVERSION at commit G will be E-2-gXXXX,
> > but at commit H it will be C-3-gXXXX.
> At H I'd expect C-1-gXXXX.
> 
> I think in general using --first-parent is wrong. It's only in some
> workflows (i.e. when there is a single person that does "mainline
> merges") where the first parent is special.
This is result of discussion with Michael Olbrich.

> 
> > 
> > With --first-parent it will be E-3-gXXXX.
> > This is more intuitive result,
> > especially when more than just one branch gets merged.
> > 
> > Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
> > ---
> >  scripts/kernel/setlocalversion | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/kernel/setlocalversion b/scripts/kernel/setlocalversion
> > index 3feb87dce..7eaaaf413 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 --first-parent --exact-match 2>/dev/null`"; then
> With --exact-match --first-parent is a noop, isn't it?
You are right.

> 
> > 
> >  		echo "$atag" | awk -F- '{printf("%s", $(NF))}'
> unrelated to this patch: if atag is "ELWMS-1.0-rc17" the result here is
> "rc17", isn't it?
You are right.
This behavior is untouched.
Tag "ELWMS-1.0_rc17" would give "1.0_rc17".

This is obviously missing in my posted custom rule and I have to add it to add it.
Thanks for the hint.

> 
> Best regards
> Uwe
> 

Regards Denis

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch
  2018-12-13  7:56   ` Denis OSTERLAND
@ 2018-12-13  9:37     ` Denis OSTERLAND
  0 siblings, 0 replies; 9+ messages in thread
From: Denis OSTERLAND @ 2018-12-13  9:37 UTC (permalink / raw)
  To: ptxdist

Hi,

for interested listeners, my custom auto-version with '-' handling.
It defers in format, but thats okay to me.

$ git describe
OSELAS.BSP-Pengutronix-Generic-2014.07.0-6-g3266e67

$ ./p print PTXDIST_BSP_AUTOVERSION
2014.07.0-00006-g3266e67f0b46

$ ./p print BSP_AUTOVERSION
2014.07.0-6-g3266e67

Regards Denis
---
 rules/pre/autoversion.make | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/rules/pre/autoversion.make b/rules/pre/autoversion.make
new file mode 100644
index 0000000..cceeb09
--- /dev/null
+++ b/rules/pre/autoversion.make
@@ -0,0 +1,17 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Denis Osterland <Denis.Osterland@diehl.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+AUTOVERSION_GIT_LAST_TAG := $(shell git describe --first-parent --abbrev=0)
+AUTOVERSION_GIT_DESCRIBE := $(shell git describe --first-parent --dirty)
+BSP_AUTOVERSION := $(addprefix \
+       $(lastword $(subst -, ,$(AUTOVERSION_GIT_LAST_TAG))), \
+       $(AUTOVERSION_GIT_DESCRIBE:$(AUTOVERSION_GIT_LAST_TAG)%=%))
+
+# vim: syntax=make

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2018-12-13  9:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-12  9:14 [ptxdist] [PATCH] setlocalversion: only use tags actually on current branch Denis OSTERLAND
2018-12-12  9:47 ` Alexander Dahl
2018-12-12 13:51 ` Michael Olbrich
2018-12-12 14:35   ` Denis OSTERLAND
2018-12-12 14:53     ` Michael Olbrich
2018-12-12 15:32       ` Denis OSTERLAND
2018-12-13  7:29 ` Uwe Kleine-König
2018-12-13  7:56   ` Denis OSTERLAND
2018-12-13  9:37     ` Denis OSTERLAND

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