From: Martin Jansa <martin.jansa@gmail.com>
To: bitbake-devel@lists.openembedded.org
Subject: [RFC] WIP: git: prefix with refs/tags/ when revision isn't git hash
Date: Sun, 11 Aug 2013 10:36:37 +0200 [thread overview]
Message-ID: <1376210197-10265-1-git-send-email-Martin.Jansa@gmail.com> (raw)
* many Open webOS components have tag in format
submissions/N, versions/X.Y.Z
just by chance I've noticed that git ls-remote behaves a bit different
than what I've expected:
We were using tag=18 in SRC_URI.
librolegen repository doesn't have tag '18'
$ git tag -l
submissions/0
submissions/16
submissions/17
submissions/18
version/2.0.0
versions/2.1.0
It was working correctly until now, just because we were lucky.
From git help ls-remote:
When <refs>... are specified, only references matching the given
patterns are displayed.
$ git ls-remote git://github.com/openwebos/librolegen 18
cbedc69733f65cd2f498787a621c014e219d38ab refs/tags/submissions/18
$ git ls-remote git://github.com/openwebos/librolegen 17
af5b0e7b514938d5589c89ab9508ad23dce43e98 refs/tags/submissions/17
$ git ls-remote git://github.com/openwebos/librolegen
9040954a24115b05219e7dd459dcf91ad05cc739 HEAD
9040954a24115b05219e7dd459dcf91ad05cc739 refs/heads/master
85524970dba46557d3c9672455a4a88165efe7f1 refs/notes/review
fe509e33f5d68c834bce087dff0f6c801d869b68 refs/tags/submissions/0
04bc2c24ce628de3ac0fba8afce088f2391f96bb refs/tags/submissions/0^{}
7aa394eea6bd76618337772894f7615d0ae8e13a refs/tags/submissions/16
af5b0e7b514938d5589c89ab9508ad23dce43e98 refs/tags/submissions/17
cbedc69733f65cd2f498787a621c014e219d38ab refs/tags/submissions/18
9040954a24115b05219e7dd459dcf91ad05cc739 refs/tags/submissions/18^{}
7aa394eea6bd76618337772894f7615d0ae8e13a refs/tags/version/2.0.0
af5b0e7b514938d5589c89ab9508ad23dce43e98 refs/tags/versions/2.1.0
So if someone creates tag 'foo/18' ls-remote will return both lines and
build will fail.
Prefixing with 'refs/tags/' will work in this case, but I haven't tested
if this code breaks AUTOREV or other use-cases -> that's why it's RFC + WIP.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
lib/bb/fetch2/git.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 6175e4c..ebb5722 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -124,7 +124,7 @@ class Git(FetchMethod):
# Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
if ud.revisions[name]:
- ud.branches[name] = ud.revisions[name]
+ ud.branches[name] = "refs/tags/%s" % ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud.url, ud, d, name)
gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.').replace('*', '.'))
--
1.8.3.2
next reply other threads:[~2013-08-11 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-11 8:36 Martin Jansa [this message]
2013-08-12 11:26 ` [RFC] WIP: git: prefix with refs/tags/ when revision isn't git hash Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376210197-10265-1-git-send-email-Martin.Jansa@gmail.com \
--to=martin.jansa@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox