[dpdk-dev] scripts: fix abi-validator regression when revision is a tag

Message ID e925ac7bbf1eb54df80f7c7dd4f7f3d65e550069.1450187715.git.pmatilai@redhat.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Panu Matilainen Dec. 15, 2015, 1:55 p.m. UTC
  Commit 9cbae2aa64eb managed to break the only previously supported
case where a tag is used as a revision, due to git show output
differing between tags and other objects. The hash is on the last
line of the output in both cases though so just grab that.

Fixes: 9cbae2aa64eb ("scripts: support any git revisions as ABI validation range")
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 scripts/validate-abi.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Neil Horman Dec. 15, 2015, 2:16 p.m. UTC | #1
On Tue, Dec 15, 2015 at 03:55:15PM +0200, Panu Matilainen wrote:
> Commit 9cbae2aa64eb managed to break the only previously supported
> case where a tag is used as a revision, due to git show output
> differing between tags and other objects. The hash is on the last
> line of the output in both cases though so just grab that.
> 
> Fixes: 9cbae2aa64eb ("scripts: support any git revisions as ABI validation range")
> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> ---
>  scripts/validate-abi.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
> index 8d7be24..c36ad61 100755
> --- a/scripts/validate-abi.sh
> +++ b/scripts/validate-abi.sh
> @@ -121,8 +121,8 @@ then
>  	cleanup_and_exit 1
>  fi
>  
> -HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null)
> -HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null)
> +HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null | tail -1)
> +HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null | tail -1)
>  
>  # Make sure our tags exist
>  res=$(validate_tags)
> -- 
> 2.5.0
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>
  
Thomas Monjalon Dec. 15, 2015, 2:20 p.m. UTC | #2
2015-12-15 09:16, Neil Horman:
> On Tue, Dec 15, 2015 at 03:55:15PM +0200, Panu Matilainen wrote:
> > Commit 9cbae2aa64eb managed to break the only previously supported
> > case where a tag is used as a revision, due to git show output
> > differing between tags and other objects. The hash is on the last
> > line of the output in both cases though so just grab that.
> > 
> > Fixes: 9cbae2aa64eb ("scripts: support any git revisions as ABI validation range")
> > Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> > ---
> >  scripts/validate-abi.sh | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
> > index 8d7be24..c36ad61 100755
> > --- a/scripts/validate-abi.sh
> > +++ b/scripts/validate-abi.sh
> > @@ -121,8 +121,8 @@ then
> >  	cleanup_and_exit 1
> >  fi
> >  
> > -HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null)
> > -HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null)
> > +HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null | tail -1)
> > +HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null | tail -1)
> >  
> >  # Make sure our tags exist
> >  res=$(validate_tags)
> Acked-by: Neil Horman <nhorman@tuxdriver.com>

Applied, thanks
  

Patch

diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
index 8d7be24..c36ad61 100755
--- a/scripts/validate-abi.sh
+++ b/scripts/validate-abi.sh
@@ -121,8 +121,8 @@  then
 	cleanup_and_exit 1
 fi
 
-HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null)
-HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null)
+HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null | tail -1)
+HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null | tail -1)
 
 # Make sure our tags exist
 res=$(validate_tags)