* [PATCH] fetch2/git: Anchor names when using ls-remote
@ 2014-01-20 15:21 Richard Purdie
2014-01-20 15:57 ` Olof Johansson
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2014-01-20 15:21 UTC (permalink / raw)
To: bitbake-devel
When specifying tags, they're searched for unanchored so foo/bar could
match:
refs/heads/abc/foo/bar
refs/heads/xyz/foo/bar
refs/heads/foo/bar
This change anchors the expressions so they are based against heads
or tags (or any other base level tree that has been created).
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index ed55f43..0a2e7bc 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -326,7 +326,7 @@ class Git(FetchMethod):
else:
username = ""
- cmd = "%s ls-remote %s://%s%s%s %s^{}" % \
+ cmd = "%s ls-remote %s://%s%s%s refs/*/%s^{}" % \
(ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name])
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, cmd)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2/git: Anchor names when using ls-remote
2014-01-20 15:21 [PATCH] fetch2/git: Anchor names when using ls-remote Richard Purdie
@ 2014-01-20 15:57 ` Olof Johansson
2014-01-20 16:18 ` Martin Jansa
0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2014-01-20 15:57 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
On 14-01-20 16:21 +0100, Richard Purdie wrote:
> When specifying tags, they're searched for unanchored so foo/bar could
> match:
>
> refs/heads/abc/foo/bar
> refs/heads/xyz/foo/bar
> refs/heads/foo/bar
>
> This change anchors the expressions so they are based against heads
> or tags (or any other base level tree that has been created).
Afaict, ls-remote matches the wildcard character against any
character, including /.
$ git ls-remote gittest refs/*/foo/bar
69ab4bdbb5f3725ca594a2abdb636ee8fc25e1c4 refs/tags/abc/foo/bar
c8647b027d88af180e90d842577518b73ef6a167 refs/tags/foo/bar
149c3c329515086af1ae4e24b12b17100ae16256 refs/tags/xyz/foo/bar
--
olofjn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2/git: Anchor names when using ls-remote
2014-01-20 15:57 ` Olof Johansson
@ 2014-01-20 16:18 ` Martin Jansa
2014-01-20 16:28 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: Martin Jansa @ 2014-01-20 16:18 UTC (permalink / raw)
To: Olof Johansson; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 972 bytes --]
On Mon, Jan 20, 2014 at 04:57:34PM +0100, Olof Johansson wrote:
> On 14-01-20 16:21 +0100, Richard Purdie wrote:
> > When specifying tags, they're searched for unanchored so foo/bar could
> > match:
> >
> > refs/heads/abc/foo/bar
> > refs/heads/xyz/foo/bar
> > refs/heads/foo/bar
> >
> > This change anchors the expressions so they are based against heads
> > or tags (or any other base level tree that has been created).
>
> Afaict, ls-remote matches the wildcard character against any
> character, including /.
>
> $ git ls-remote gittest refs/*/foo/bar
> 69ab4bdbb5f3725ca594a2abdb636ee8fc25e1c4 refs/tags/abc/foo/bar
> c8647b027d88af180e90d842577518b73ef6a167 refs/tags/foo/bar
> 149c3c329515086af1ae4e24b12b17100ae16256 refs/tags/xyz/foo/bar
Yes, I've seen the same behavior:
http://lists.openembedded.org/pipermail/bitbake-devel/2013-August/003724.html
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2/git: Anchor names when using ls-remote
2014-01-20 16:18 ` Martin Jansa
@ 2014-01-20 16:28 ` Richard Purdie
2014-01-20 16:39 ` Martin Jansa
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2014-01-20 16:28 UTC (permalink / raw)
To: Martin Jansa; +Cc: bitbake-devel
On Mon, 2014-01-20 at 17:18 +0100, Martin Jansa wrote:
> On Mon, Jan 20, 2014 at 04:57:34PM +0100, Olof Johansson wrote:
> > On 14-01-20 16:21 +0100, Richard Purdie wrote:
> > > When specifying tags, they're searched for unanchored so foo/bar could
> > > match:
> > >
> > > refs/heads/abc/foo/bar
> > > refs/heads/xyz/foo/bar
> > > refs/heads/foo/bar
> > >
> > > This change anchors the expressions so they are based against heads
> > > or tags (or any other base level tree that has been created).
> >
> > Afaict, ls-remote matches the wildcard character against any
> > character, including /.
> >
> > $ git ls-remote gittest refs/*/foo/bar
> > 69ab4bdbb5f3725ca594a2abdb636ee8fc25e1c4 refs/tags/abc/foo/bar
> > c8647b027d88af180e90d842577518b73ef6a167 refs/tags/foo/bar
> > 149c3c329515086af1ae4e24b12b17100ae16256 refs/tags/xyz/foo/bar
>
> Yes, I've seen the same behavior:
>
> http://lists.openembedded.org/pipermail/bitbake-devel/2013-August/003724.html
>
Hmm, ok, we can explicitly do:
git ls-remote xxx refs/heads/X refs/tags/X
which should resolve this...
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2/git: Anchor names when using ls-remote
2014-01-20 16:28 ` Richard Purdie
@ 2014-01-20 16:39 ` Martin Jansa
0 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2014-01-20 16:39 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
On Mon, Jan 20, 2014 at 04:28:16PM +0000, Richard Purdie wrote:
> On Mon, 2014-01-20 at 17:18 +0100, Martin Jansa wrote:
> > On Mon, Jan 20, 2014 at 04:57:34PM +0100, Olof Johansson wrote:
> > > On 14-01-20 16:21 +0100, Richard Purdie wrote:
> > > > When specifying tags, they're searched for unanchored so foo/bar could
> > > > match:
> > > >
> > > > refs/heads/abc/foo/bar
> > > > refs/heads/xyz/foo/bar
> > > > refs/heads/foo/bar
> > > >
> > > > This change anchors the expressions so they are based against heads
> > > > or tags (or any other base level tree that has been created).
> > >
> > > Afaict, ls-remote matches the wildcard character against any
> > > character, including /.
> > >
> > > $ git ls-remote gittest refs/*/foo/bar
> > > 69ab4bdbb5f3725ca594a2abdb636ee8fc25e1c4 refs/tags/abc/foo/bar
> > > c8647b027d88af180e90d842577518b73ef6a167 refs/tags/foo/bar
> > > 149c3c329515086af1ae4e24b12b17100ae16256 refs/tags/xyz/foo/bar
> >
> > Yes, I've seen the same behavior:
> >
> > http://lists.openembedded.org/pipermail/bitbake-devel/2013-August/003724.html
> >
>
> Hmm, ok, we can explicitly do:
>
> git ls-remote xxx refs/heads/X refs/tags/X
>
> which should resolve this...
Looks better to me.
Or if we can be very strict we could use refs/heads/ only when there
isn't tag param and refs/tags/ when there is, which would prevent using
tag=dead8928392 (as git revision not name of tag).
I don't know how many recipes are using tag= param like this, we do in
meta-webos, but I would rather fixed that before upgrading to next
release.
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-20 16:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 15:21 [PATCH] fetch2/git: Anchor names when using ls-remote Richard Purdie
2014-01-20 15:57 ` Olof Johansson
2014-01-20 16:18 ` Martin Jansa
2014-01-20 16:28 ` Richard Purdie
2014-01-20 16:39 ` Martin Jansa
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.