All of lore.kernel.org
 help / color / mirror / Atom feed
* [yocto-autobuilder][PATCH] buildsteps/CheckOutLayers: use a commit object for git rev-parse
@ 2013-10-10 13:18 Stefan Stanacar
  2013-10-17 19:52 ` Flanagan, Elizabeth
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Stanacar @ 2013-10-10 13:18 UTC (permalink / raw)
  To: yocto

When the object passed to git rev-parse is a tag, we need to dereference
the tag until a commit id is found or the object cannot be dereferenced
anymore hence add ^0. (<rev>^0 is a short-hand for <rev>^{commit})

This avoids confusing tarballs like
http://autobuilder.yoctoproject.org/pub/releases/dora-10.0.0/poky-319e24a8b1e100e950b07bbcad5fc81c42396845.tar.bz2
which have the SHA-1 hash of the tag instead of the commit.
It was first mentioned here
https://lists.yoctoproject.org/pipermail/yocto/2013-October/018607.html

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
---
 lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py b/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
index f7b7d6e..46f9b25 100644
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
@@ -128,7 +128,7 @@ class CheckOutLayers(Git):
 
     @defer.inlineCallbacks
     def parseGotRevision(self, _=None):
-        stdout = yield self._dovccmd(['rev-parse', self.commit], collectStdout=True)
+        stdout = yield self._dovccmd(['rev-parse', self.commit + "^0"], collectStdout=True)
         revision = stdout.strip()
         if len(revision) != 40:
             raise buildstep.BuildStepFailed()
-- 
1.8.3.1



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

* Re: [yocto-autobuilder][PATCH] buildsteps/CheckOutLayers: use a commit object for git rev-parse
  2013-10-10 13:18 [yocto-autobuilder][PATCH] buildsteps/CheckOutLayers: use a commit object for git rev-parse Stefan Stanacar
@ 2013-10-17 19:52 ` Flanagan, Elizabeth
  0 siblings, 0 replies; 2+ messages in thread
From: Flanagan, Elizabeth @ 2013-10-17 19:52 UTC (permalink / raw)
  To: Stefan Stanacar; +Cc: yocto

Stefan,

I'm pulling this patch, as this is part of our override of
parseGotRevision in buildbot/steps/source/git.py, but I'd also suggest
that this get suggested to the buildbot project for the original
parseGotRevision.

-b

On Thu, Oct 10, 2013 at 6:18 AM, Stefan Stanacar
<stefanx.stanacar@intel.com> wrote:
> When the object passed to git rev-parse is a tag, we need to dereference
> the tag until a commit id is found or the object cannot be dereferenced
> anymore hence add ^0. (<rev>^0 is a short-hand for <rev>^{commit})
>
> This avoids confusing tarballs like
> http://autobuilder.yoctoproject.org/pub/releases/dora-10.0.0/poky-319e24a8b1e100e950b07bbcad5fc81c42396845.tar.bz2
> which have the SHA-1 hash of the tag instead of the commit.
> It was first mentioned here
> https://lists.yoctoproject.org/pipermail/yocto/2013-October/018607.html
>
> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
> ---
>  lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py b/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
> index f7b7d6e..46f9b25 100644
> --- a/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
> +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
> @@ -128,7 +128,7 @@ class CheckOutLayers(Git):
>
>      @defer.inlineCallbacks
>      def parseGotRevision(self, _=None):
> -        stdout = yield self._dovccmd(['rev-parse', self.commit], collectStdout=True)
> +        stdout = yield self._dovccmd(['rev-parse', self.commit + "^0"], collectStdout=True)
>          revision = stdout.strip()
>          if len(revision) != 40:
>              raise buildstep.BuildStepFailed()
> --
> 1.8.3.1
>



-- 
Elizabeth Flanagan
Yocto Project
Build and Release


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

end of thread, other threads:[~2013-10-17 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-10 13:18 [yocto-autobuilder][PATCH] buildsteps/CheckOutLayers: use a commit object for git rev-parse Stefan Stanacar
2013-10-17 19:52 ` Flanagan, Elizabeth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.