diff mbox

scripts/git_hash: match more digits

Message ID 1462223267-28942-1-git-send-email-anders.roxell@linaro.org
State Accepted
Commit 5082355f4916ac62dee8e3a43b1777d681fec75a
Headers show

Commit Message

Anders Roxell May 2, 2016, 9:07 p.m. UTC
Make it possible to match more digits than groups of one.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 scripts/git_hash.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ricardo Salveti May 3, 2016, 5:29 a.m. UTC | #1
On Mon, May 2, 2016 at 6:07 PM, Anders Roxell <anders.roxell@linaro.org> wrote:
> Make it possible to match more digits than groups of one.
>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  scripts/git_hash.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
> index 6ba265e..336eb01 100755
> --- a/scripts/git_hash.sh
> +++ b/scripts/git_hash.sh
> @@ -7,7 +7,8 @@ fi
>  ROOTDIR=${1}
>
>  if [ -d ${ROOTDIR}/.git ]; then
> -       hash=$(git --git-dir=${ROOTDIR}/.git describe  --match 'v?\.?\.?\.?' | tr -d "\n")
> +       hash=$(git --git-dir=${ROOTDIR}/.git describe --match 'v[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'\
> +              | tr -d "\n")
>         if [[ $(git --git-dir=${ROOTDIR}/.git diff --shortstat 2> /dev/null \
>                 | tail -n1) != "" ]]; then
>                 dirty=.dirty
> --
> 2.1.4

Reviewed-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Mike Holmes May 3, 2016, 6 p.m. UTC | #2
Merged

On 3 May 2016 at 01:29, Ricardo Salveti <ricardo.salveti@linaro.org> wrote:

> On Mon, May 2, 2016 at 6:07 PM, Anders Roxell <anders.roxell@linaro.org>

> wrote:

> > Make it possible to match more digits than groups of one.

> >

> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> > ---

> >  scripts/git_hash.sh | 3 ++-

> >  1 file changed, 2 insertions(+), 1 deletion(-)

> >

> > diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh

> > index 6ba265e..336eb01 100755

> > --- a/scripts/git_hash.sh

> > +++ b/scripts/git_hash.sh

> > @@ -7,7 +7,8 @@ fi

> >  ROOTDIR=${1}

> >

> >  if [ -d ${ROOTDIR}/.git ]; then

> > -       hash=$(git --git-dir=${ROOTDIR}/.git describe  --match

> 'v?\.?\.?\.?' | tr -d "\n")

> > +       hash=$(git --git-dir=${ROOTDIR}/.git describe --match

> 'v[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'\

> > +              | tr -d "\n")

> >         if [[ $(git --git-dir=${ROOTDIR}/.git diff --shortstat 2>

> /dev/null \

> >                 | tail -n1) != "" ]]; then

> >                 dirty=.dirty

> > --

> > 2.1.4

>

> Reviewed-by: Ricardo Salveti <ricardo.salveti@linaro.org>

>

> --

> Ricardo Salveti

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
diff mbox

Patch

diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
index 6ba265e..336eb01 100755
--- a/scripts/git_hash.sh
+++ b/scripts/git_hash.sh
@@ -7,7 +7,8 @@  fi
 ROOTDIR=${1}
 
 if [ -d ${ROOTDIR}/.git ]; then
-	hash=$(git --git-dir=${ROOTDIR}/.git describe  --match 'v?\.?\.?\.?' | tr -d "\n")
+	hash=$(git --git-dir=${ROOTDIR}/.git describe --match 'v[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'\
+	       | tr -d "\n")
 	if [[ $(git --git-dir=${ROOTDIR}/.git diff --shortstat 2> /dev/null \
 		| tail -n1) != "" ]]; then
 		dirty=.dirty