From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Andrei Gherzan <andrei@gherzan.ro>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] bitbake: bb.fetch2.git: Fix _latest_revision function while using tags
Date: Tue, 07 Jan 2014 13:38:28 +0000 [thread overview]
Message-ID: <1389101908.6899.23.camel@ted> (raw)
In-Reply-To: <1388886808-25624-1-git-send-email-andrei@gherzan.ro>
On Sun, 2014-01-05 at 03:53 +0200, Andrei Gherzan wrote:
> When getting the revision we must take into consideration if the name we are
> looking for is a tag and in that case we need the dereferenced commit ID in
> order to check for it existance in a specific branch.
>
> So first search for the reference^{} commit ID and only if that returns nothing
> get the name as it is.
In what case would reference^{} fail to work when reference would?
Reading the git documentation, I'm struggling to see a case when ^{}
wouldn't do the right thing and if that is the case we don't need the
fallback?
Cheers,
Richard
> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
> ---
> bitbake/lib/bb/fetch2/git.py | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> index b4b9368..1584232 100644
> --- a/bitbake/lib/bb/fetch2/git.py
> +++ b/bitbake/lib/bb/fetch2/git.py
> @@ -318,9 +318,13 @@ class Git(FetchMethod):
> (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name])
> if ud.proto.lower() != 'file':
> bb.fetch2.check_network_access(d, cmd)
> - output = runfetchcmd(cmd, d, True)
> + # Maybe the ref is a tag so try to dereference it first
> + output = runfetchcmd(cmd + '^{}', d, True)
> if not output:
> - raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
> + # Dereference gave nothing so try to get it as it is
> + output = runfetchcmd(cmd, d, True)
> + if not output:
> + raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
> return output.split()[0]
>
> def _build_revision(self, ud, d, name):
prev parent reply other threads:[~2014-01-07 13:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-05 1:53 [PATCH] bitbake: bb.fetch2.git: Fix _latest_revision function while using tags Andrei Gherzan
2014-01-07 10:36 ` Olof Johansson
2014-01-07 13:40 ` Richard Purdie
2014-01-07 14:46 ` Olof Johansson
2014-01-07 15:02 ` Richard Purdie
2014-01-07 15:48 ` Olof Johansson
2014-01-07 17:18 ` Andrei Gherzan
2014-01-07 13:38 ` Richard Purdie [this message]
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=1389101908.6899.23.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=andrei@gherzan.ro \
--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