[ofa-general] [PATCH] ibutils: git-log calls have been changed to git log as git-xxx syntax is not working with latest git releases

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Apr 26 07:44:10 PDT 2009


Jason, Nicolas,

Thanks a lot.

Jason Gunthorpe wrote:
> On Tue, Apr 21, 2009 at 09:50:06AM +0200, Nicolas Morey-Chaisemartin wrote:
>  
>> Signed-off-by: Nicolas Morey-Chaisemartin 
>> <nicolas.morey-chaisemartin at ext.bull.net>
>>  ibdiag/src/Makefile.am   |    2 +-
>>  ibdm/ibdm/Makefile.am    |    2 +-
>>  ibis/src/Makefile.am     |    2 +-
>>  ibmgtsim/src/Makefile.am |    2 +-
>>  4 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/ibdiag/src/Makefile.am b/ibdiag/src/Makefile.am
>> index def8b0a..7158bbd 100644
>> +++ b/ibdiag/src/Makefile.am
>> @@ -42,7 +42,7 @@ GIT=$(shell which git)
>>  
>>  git_version.tcl : @MAINTAINER_MODE_TRUE@ FORCE
>>  	if test x$(GIT) != x ; then \
>> -	   gitver=`cd $(srcdir) ; git-log | head -1 | cut -f2 -d\  `; \
>> +	   gitver=`cd $(srcdir) ; git log | head -1 | cut -f2 -d\  `; \
>>  	   changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
> 
> Gah, that is an awful choice of command for this purpose anyhow. All
> of those should just be:
> 
> git rev-parse --verify HEAD

I'm using this suggestion. Something like this:

diff --git a/ibdiag/src/Makefile.am b/ibdiag/src/Makefile.am
index def8b0a..d32d914 100644
--- a/ibdiag/src/Makefile.am
+++ b/ibdiag/src/Makefile.am
@@ -42,7 +42,7 @@ GIT=$(shell which git)

 git_version.tcl : @MAINTAINER_MODE_TRUE@ FORCE
        if test x$(GIT) != x ; then \
-          gitver=`cd $(srcdir) ; git-log | head -1 | cut -f2 -d\  `; \
+          gitver=`cd $(srcdir) ; rev-parse --verify HEAD`; \
           changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
        else \
           gitver=undefined; changes=0; \
diff --git a/ibdm/ibdm/Makefile.am b/ibdm/ibdm/Makefile.am
index b0958fc..1c57b3b 100644
--- a/ibdm/ibdm/Makefile.am
+++ b/ibdm/ibdm/Makefile.am
@@ -96,7 +96,7 @@ GIT=$(shell which git)

 $(srcdir)/git_version.h:  @MAINTAINER_MODE_TRUE@ FORCE
        if test x$(GIT) != x ; then \
-          gitver=`cd $(srcdir) ; git-log | head -1 | cut -f2 -d\  `; \
+          gitver=`cd $(srcdir) ; git rev-parse --verify HEAD`; \
           changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
        else \
           gitver=undefined; changes=0; \
diff --git a/ibis/src/Makefile.am b/ibis/src/Makefile.am
index 7f415f0..b535297 100644
--- a/ibis/src/Makefile.am
+++ b/ibis/src/Makefile.am
@@ -98,7 +98,7 @@ GIT=$(shell which git)

 $(srcdir)/git_version.h:  @MAINTAINER_MODE_TRUE@ FORCE
        if test x$(GIT) != x ; then \
-          gitver=`cd $(srcdir) ; git-log | head -1 | cut -f2 -d\  `; \
+          gitver=`cd $(srcdir) ; git rev-parse --verify HEAD`; \
           changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
        else \
           gitver=undefined; changes=0; \
diff --git a/ibmgtsim/src/Makefile.am b/ibmgtsim/src/Makefile.am
index 6585a11..f23f2d8 100644
--- a/ibmgtsim/src/Makefile.am
+++ b/ibmgtsim/src/Makefile.am
@@ -95,7 +95,7 @@ GIT=$(shell which git)

 $(srcdir)/git_version.h:  @MAINTAINER_MODE_TRUE@ FORCE
        if test x$(GIT) != x ; then \
-          gitver=`cd $(srcdir) ; git-log | head -1 | cut -f2 -d\  `; \
+          gitver=`cd $(srcdir) ; git rev-parse --verify HEAD`; \
           changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
        else \
           gitver=undefined; changes=0; \

Will push it shortly.

-- Yevgeny

 
> Which gives the same output, dramatically faster.
> 
> Jason


 




More information about the general mailing list