[Sound-open-firmware] [PATCH] git-version: Fix REEF_TAG bug when having rc tags
From: Pan Xiuli xiuli.pan@linux.intel.com
Use git log to make sure REEF_TAG has git commit. --- git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-version.sh b/git-version.sh index faa0daa..1c2d275 100755 --- a/git-version.sh +++ b/git-version.sh @@ -7,7 +7,7 @@ git describe --abbrev=4 > .version git describe --abbrev=4 > .tarball-version
# git commit for IPC -echo "#define REEF_TAG "`git describe --abbrev=4 | cut -d- -f3`"" > src/include/version.h +echo "#define REEF_TAG "`git log --pretty=format:"%h" -1 | cut -c1-5`"" > src/include/version.h
# build counter if [ -e .build ]; then
On 2017年12月04日 03:40, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Use git log to make sure REEF_TAG has git commit.
can you explain why it doesn't have git commit previously?
git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-version.sh b/git-version.sh index faa0daa..1c2d275 100755 --- a/git-version.sh +++ b/git-version.sh @@ -7,7 +7,7 @@ git describe --abbrev=4 > .version git describe --abbrev=4 > .tarball-version
# git commit for IPC -echo "#define REEF_TAG "`git describe --abbrev=4 | cut -d- -f3`"" > src/include/version.h
with this, we will output "gxxxx" to version.h
+echo "#define REEF_TAG "`git log --pretty=format:"%h" -1 | cut -c1-5`"" > src/include/version.h
how about this?
Thanks, ~Keyon
# build counter if [ -e .build ]; then
From: Pan Xiuli xiuli.pan@linux.intel.com
Use git log to make sure REEF_TAG has git commit.
can you explain why it doesn't have git commit previously?
git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-version.sh b/git-version.sh index faa0daa..1c2d275 100755 --- a/git-version.sh +++ b/git-version.sh @@ -7,7 +7,7 @@ git describe --abbrev=4 > .version git describe --abbrev=4 > .tarball-version
# git commit for IPC -echo "#define REEF_TAG "`git describe --abbrev=4 | cut -d- -f3`"" >
src/include/version.h
with this, we will output "gxxxx" to version.h
+echo "#define REEF_TAG "`git log --pretty=format:"%h" -1 | cut -c1-5`"" >
src/include/version.h
how about this?
We only use git as our code manger, so this will get xxxxx without the g. Or we can get anything we'd like and did not depend on the git describe.
Thanks Xiuli
Thanks, ~Keyon
# build counter if [ -e .build ]; then
On Mon, 2017-12-04 at 09:38 +0000, Pan, Xiuli wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Use git log to make sure REEF_TAG has git commit.
can you explain why it doesn't have git commit previously?
git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-version.sh b/git-version.sh index faa0daa..1c2d275 100755 --- a/git-version.sh +++ b/git-version.sh @@ -7,7 +7,7 @@ git describe --abbrev=4 > .version git describe --abbrev=4 > .tarball-version
# git commit for IPC -echo "#define REEF_TAG "`git describe --abbrev=4 | cut -d- -f3`"" >
src/include/version.h
with this, we will output "gxxxx" to version.h
+echo "#define REEF_TAG "`git log --pretty=format:"%h" -1 | cut -c1-5`"" >
src/include/version.h
how about this?
We only use git as our code manger, so this will get xxxxx without the g. Or we can get anything we'd like and did not depend on the git describe.
Can you give me an real example of before and after ?
Thanks
Liam
OK, here is a example Before as for RC2 branch: git describe --abbrev=4 will get v1.0-rc2-1-gf310 ( g here means git to show we use git as code manager in case svn or other tools are used we may not need this) git describe --abbrev=4 | cut -d- -f3 will get 1 ( this 1 means 1 more commit is added since the rc2 tag) As we add a '-rc2' in the tag, this cut script detect with '-' will fail with hard code -f3, in this case we need -f4 to get the real commit tag.
If we just get the log commit hash id with git log --pretty=format:%h -1 | cut -c1-5 we get f3106
This can work when any tag is set for the git repo.
Thanks Xiuli
-----Original Message----- From: Liam Girdwood [mailto:liam.r.girdwood@linux.intel.com] Sent: Monday, December 4, 2017 18:21 To: Pan, Xiuli xiuli.pan@intel.com; Keyon Jie yang.jie@linux.intel.com; Xiuli Pan xiuli.pan@linux.intel.com; sound-open-firmware@alsa-project.org Subject: Re: [Sound-open-firmware] [PATCH] git-version: Fix REEF_TAG bug when having rc tags
On Mon, 2017-12-04 at 09:38 +0000, Pan, Xiuli wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Use git log to make sure REEF_TAG has git commit.
can you explain why it doesn't have git commit previously?
git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-version.sh b/git-version.sh index faa0daa..1c2d275 100755 --- a/git-version.sh +++ b/git-version.sh @@ -7,7 +7,7 @@ git describe --abbrev=4 > .version git describe --abbrev=4 > .tarball-version
# git commit for IPC -echo "#define REEF_TAG "`git describe --abbrev=4 | cut -d- -f3`"" >
src/include/version.h
with this, we will output "gxxxx" to version.h
+echo "#define REEF_TAG "`git log --pretty=format:"%h" -1 | cut -c1-5`"" >
src/include/version.h
how about this?
We only use git as our code manger, so this will get xxxxx without the g. Or we can get anything we'd like and did not depend on the git describe.
Can you give me an real example of before and after ?
Thanks
Liam
On Tue, 2017-12-05 at 03:21 +0000, Pan, Xiuli wrote:
OK, here is a example Before as for RC2 branch: git describe --abbrev=4 will get v1.0-rc2-1-gf310 ( g here means git to show we use git as code manager in case svn or other tools are used we may not need this) git describe --abbrev=4 | cut -d- -f3 will get 1 ( this 1 means 1 more commit is added since the rc2 tag) As we add a '-rc2' in the tag, this cut script detect with '-' will fail with hard code -f3, in this case we need -f4 to get the real commit tag.
If we just get the log commit hash id with git log --pretty=format:%h -1 | cut -c1-5 we get f3106
This can work when any tag is set for the git repo.
Ok, you may also need to increase the size of the FW version string too as part of this patch (including the kernel IPC header too).
Liam
Hi Liam,
I cut the commit to fit the size in FW. I will ask Zhigang about this. I also have some idea about insert more info in the FW info to make debug easier.
Thanks Xiuli
-----Original Message----- From: Liam Girdwood [mailto:liam.r.girdwood@linux.intel.com] Sent: Tuesday, December 5, 2017 15:13 To: Pan, Xiuli xiuli.pan@intel.com; Keyon Jie yang.jie@linux.intel.com; Xiuli Pan xiuli.pan@linux.intel.com; sound-open-firmware@alsa-project.org Subject: Re: [Sound-open-firmware] [PATCH] git-version: Fix REEF_TAG bug when having rc tags
On Tue, 2017-12-05 at 03:21 +0000, Pan, Xiuli wrote:
OK, here is a example Before as for RC2 branch: git describe --abbrev=4 will get v1.0-rc2-1-gf310 ( g here means git to show we use git as code manager in case svn or other tools are used we may not need this) git describe --abbrev=4 | cut -d- -f3 will get 1 ( this 1 means 1 more commit is added since the rc2 tag) As we add a '-rc2' in the tag, this cut script detect with '-' will fail with hard code -f3, in this case we need -f4 to get the real commit tag.
If we just get the log commit hash id with git log --pretty=format:%h -1 | cut -c1-5 we get f3106
This can work when any tag is set for the git repo.
Ok, you may also need to increase the size of the FW version string too as part of this patch (including the kernel IPC header too).
Liam
On Mon, 2017-12-04 at 03:40 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Use git log to make sure REEF_TAG has git commit.
git-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied.
participants (4)
-
Keyon Jie
-
Liam Girdwood
-
Pan, Xiuli
-
Xiuli Pan