* fetch2/git: Dereference unresolved names with ls-remote
@ 2014-01-20 15:21 Richard Purdie
2014-01-20 20:47 ` [PATCH v2] " Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2014-01-20 15:21 UTC (permalink / raw)
To: bitbake-devel
We need to deference names when trying to map them to commit IDs with
ls-remote. If we don't do this, a given commit might not show up
later in a specific branch. There appears to be no good reason not
to do this.
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 cae1653..ed55f43 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 %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] 4+ messages in thread* [PATCH v2] fetch2/git: Dereference unresolved names with ls-remote
2014-01-20 15:21 fetch2/git: Dereference unresolved names with ls-remote Richard Purdie
@ 2014-01-20 20:47 ` Richard Purdie
2014-02-03 22:11 ` Bernhard Reutner-Fischer
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2014-01-20 20:47 UTC (permalink / raw)
To: bitbake-devel
We need to deference tags when trying to map them to commit IDs with
ls-remote. If we don't do this, a given commit might not show up
later in a specific branch. There appears to be no good reason not
to do this.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
v2: Only apply ^{} to tags, not heads
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index d73f0cb..f7c26b3 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 refs/heads/%s refs/tags/%s" % \
+ cmd = "%s ls-remote %s://%s%s%s refs/heads/%s refs/tags/%s^{}" % \
(ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name], ud.unresolvedrev[name])
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, cmd)
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] fetch2/git: Dereference unresolved names with ls-remote
2014-01-20 20:47 ` [PATCH v2] " Richard Purdie
@ 2014-02-03 22:11 ` Bernhard Reutner-Fischer
2014-02-03 23:43 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Reutner-Fischer @ 2014-02-03 22:11 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
On Mon, Jan 20, 2014 at 08:47:30PM +0000, Richard Purdie wrote:
> We need to deference tags when trying to map them to commit IDs with
> ls-remote. If we don't do this, a given commit might not show up
> later in a specific branch. There appears to be no good reason not
> to do this.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>
> v2: Only apply ^{} to tags, not heads
>
> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> index d73f0cb..f7c26b3 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 refs/heads/%s refs/tags/%s" % \
> + cmd = "%s ls-remote %s://%s%s%s refs/heads/%s refs/tags/%s^{}" % \
> (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name], ud.unresolvedrev[name])
> if ud.proto.lower() != 'file':
> bb.fetch2.check_network_access(d, cmd)
Hi Richard,
This and the previous df2e0972cd1db7abd5ec8b7cb295fb0c42e284a4 are very
inconvenient for my workflow (¹).
I usually have the toolchain locally for hacking, so my gcc,
binutils-gdb, uClibc and selected apps etc look like e.g.:
$ egrep "SRC(REV|PV|_URI )" meta/recipes-devtools/gcc/gcc-4.9.inc
SRCREV = "HEAD"
PV = "4.9.0+git${SRCPV}"
SRC_URI = "git:///scratch/src/gcc-4.9.mine/;branch=fixups-rtl;protocol=file;rebaseable=1"
This worked fine until your abovementioned changes. Can you advise how
my SRC_URI should look like so i am able to keep developing and
test changes now with the lot of oe-core and meta-openembedded as
checks?
thanks,
To reproduce:
$ git init /tmp/yuck
Initialized empty Git repository in /tmp/yuck/.git/
$ cd !$
$ echo | tee a > b
$ git add a
$ git commit -q -m '1c' a
$ git ls-remote file:///tmp/yuck/ HEAD
7532c4dab272c062c117b731e97889122dc10e67 HEAD
$ git ls-remote file:///tmp/yuck/ refs/heads/HEAD refs/tags/HEAD^{}
$
¹) think http://xkcd.com/1172/ but IMHO a tad less obscure since i'm
affected ;)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] fetch2/git: Dereference unresolved names with ls-remote
2014-02-03 22:11 ` Bernhard Reutner-Fischer
@ 2014-02-03 23:43 ` Richard Purdie
0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2014-02-03 23:43 UTC (permalink / raw)
To: Bernhard Reutner-Fischer; +Cc: bitbake-devel
On Mon, 2014-02-03 at 23:11 +0100, Bernhard Reutner-Fischer wrote:
> On Mon, Jan 20, 2014 at 08:47:30PM +0000, Richard Purdie wrote:
> > We need to deference tags when trying to map them to commit IDs with
> > ls-remote. If we don't do this, a given commit might not show up
> > later in a specific branch. There appears to be no good reason not
> > to do this.
> >
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> >
> > v2: Only apply ^{} to tags, not heads
> >
> > diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> > index d73f0cb..f7c26b3 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 refs/heads/%s refs/tags/%s" % \
> > + cmd = "%s ls-remote %s://%s%s%s refs/heads/%s refs/tags/%s^{}" % \
> > (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name], ud.unresolvedrev[name])
> > if ud.proto.lower() != 'file':
> > bb.fetch2.check_network_access(d, cmd)
>
> Hi Richard,
>
> This and the previous df2e0972cd1db7abd5ec8b7cb295fb0c42e284a4 are very
> inconvenient for my workflow (¹).
> I usually have the toolchain locally for hacking, so my gcc,
> binutils-gdb, uClibc and selected apps etc look like e.g.:
>
> $ egrep "SRC(REV|PV|_URI )" meta/recipes-devtools/gcc/gcc-4.9.inc
> SRCREV = "HEAD"
> PV = "4.9.0+git${SRCPV}"
> SRC_URI = "git:///scratch/src/gcc-4.9.mine/;branch=fixups-rtl;protocol=file;rebaseable=1"
>
> This worked fine until your abovementioned changes. Can you advise how
> my SRC_URI should look like so i am able to keep developing and
> test changes now with the lot of oe-core and meta-openembedded as
> checks?
>
> thanks,
>
> To reproduce:
> $ git init /tmp/yuck
> Initialized empty Git repository in /tmp/yuck/.git/
> $ cd !$
> $ echo | tee a > b
> $ git add a
> $ git commit -q -m '1c' a
> $ git ls-remote file:///tmp/yuck/ HEAD
> 7532c4dab272c062c117b731e97889122dc10e67 HEAD
> $ git ls-remote file:///tmp/yuck/ refs/heads/HEAD refs/tags/HEAD^{}
> $
>
> ¹) think http://xkcd.com/1172/ but IMHO a tad less obscure since i'm
> affected ;)
The xkcd link made me smile :).
There may be a case here for adding in a conditional on a local repo
(file:// type) and the revision being HEAD. It is a pretty special case
but one we can probably accommodate relatively easily...
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-02-03 23:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 15:21 fetch2/git: Dereference unresolved names with ls-remote Richard Purdie
2014-01-20 20:47 ` [PATCH v2] " Richard Purdie
2014-02-03 22:11 ` Bernhard Reutner-Fischer
2014-02-03 23:43 ` Richard Purdie
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.