* [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA @ 2014-01-07 3:21 Zhenhua Luo 2014-01-07 8:34 ` Martin Jansa 0 siblings, 1 reply; 3+ messages in thread From: Zhenhua Luo @ 2014-01-07 3:21 UTC (permalink / raw) To: bitbake-devel; +Cc: b43082, b40290, b40527 For rebased git tree, some commits can be found in tag rather than branch, the change is useful for such case. Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> --- lib/bb/fetch2/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index b4b9368..6d74dbb 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -101,6 +101,8 @@ class Git(FetchMethod): ud.rebaseable = ud.parm.get("rebaseable","0") == "1" + ud.nobranch = ud.parm.get("nobranch","0") == "1" + # bareclone implies nocheckout ud.bareclone = ud.parm.get("bareclone","0") == "1" if ud.bareclone: @@ -217,7 +219,7 @@ class Git(FetchMethod): ud.repochanged = True os.chdir(ud.clonedir) for name in ud.names: - if not self._contains_ref(ud, d, name): + if not ud.nobranch and not self._contains_ref(ud, d, name): raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name])) def build_mirror_data(self, ud, d): -- 1.8.4.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA 2014-01-07 3:21 [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA Zhenhua Luo @ 2014-01-07 8:34 ` Martin Jansa 2014-01-07 10:47 ` zhenhua.luo 0 siblings, 1 reply; 3+ messages in thread From: Martin Jansa @ 2014-01-07 8:34 UTC (permalink / raw) To: Zhenhua Luo; +Cc: b43082, b40290, bitbake-devel, b40527 [-- Attachment #1: Type: text/plain, Size: 1926 bytes --] On Tue, Jan 07, 2014 at 11:21:06AM +0800, Zhenhua Luo wrote: > For rebased git tree, some commits can be found in tag rather than branch, the change > is useful for such case. > > Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> > --- > lib/bb/fetch2/git.py | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py > index b4b9368..6d74dbb 100644 > --- a/lib/bb/fetch2/git.py > +++ b/lib/bb/fetch2/git.py > @@ -101,6 +101,8 @@ class Git(FetchMethod): > > ud.rebaseable = ud.parm.get("rebaseable","0") == "1" > > + ud.nobranch = ud.parm.get("nobranch","0") == "1" > + > # bareclone implies nocheckout > ud.bareclone = ud.parm.get("bareclone","0") == "1" > if ud.bareclone: > @@ -217,7 +219,7 @@ class Git(FetchMethod): > ud.repochanged = True > os.chdir(ud.clonedir) > for name in ud.names: > - if not self._contains_ref(ud, d, name): > + if not ud.nobranch and not self._contains_ref(ud, d, name): I think that even with nobranch param set you need to check that SHA-1 is included, you just don't care in which branch if it's even included in any. Something like def _contains_ref(self, tag, branch, d): was doing before 89abfbc1953e3711d6c90aff793ee622c22609b1, so the conditional should be in _contains_ref not skipping it completely. > raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name])) > > def build_mirror_data(self, ud, d): > -- > 1.8.4.2 > > > _______________________________________________ > bitbake-devel mailing list > bitbake-devel@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/bitbake-devel -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 205 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA 2014-01-07 8:34 ` Martin Jansa @ 2014-01-07 10:47 ` zhenhua.luo 0 siblings, 0 replies; 3+ messages in thread From: zhenhua.luo @ 2014-01-07 10:47 UTC (permalink / raw) To: Martin Jansa Cc: Zongchun.Yu@freescale.com, B40290@freescale.com, bitbake-devel@lists.openembedded.org, Richard Schmitt Thanks, v2 is submitted, please review. http://patches.openembedded.org/patch/64209/ Best Regards, Zhenhua > -----Original Message----- > From: bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-devel- > bounces@lists.openembedded.org] On Behalf Of Martin Jansa > Sent: Tuesday, January 07, 2014 4:35 PM > To: Luo Zhenhua-B19537 > Cc: Schmitt Richard-B43082; Guo Chunrong-B40290; bitbake- > devel@lists.openembedded.org; Yu Zongchun-B40527 > Subject: Re: [bitbake-devel] [PATCH] bitbake: fetch2/git: add nobranch > option for SRC_URI to skip validating SHA > > On Tue, Jan 07, 2014 at 11:21:06AM +0800, Zhenhua Luo wrote: > > For rebased git tree, some commits can be found in tag rather than > > branch, the change is useful for such case. > > > > Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> > > --- > > lib/bb/fetch2/git.py | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index > > b4b9368..6d74dbb 100644 > > --- a/lib/bb/fetch2/git.py > > +++ b/lib/bb/fetch2/git.py > > @@ -101,6 +101,8 @@ class Git(FetchMethod): > > > > ud.rebaseable = ud.parm.get("rebaseable","0") == "1" > > > > + ud.nobranch = ud.parm.get("nobranch","0") == "1" > > + > > # bareclone implies nocheckout > > ud.bareclone = ud.parm.get("bareclone","0") == "1" > > if ud.bareclone: > > @@ -217,7 +219,7 @@ class Git(FetchMethod): > > ud.repochanged = True > > os.chdir(ud.clonedir) > > for name in ud.names: > > - if not self._contains_ref(ud, d, name): > > + if not ud.nobranch and not self._contains_ref(ud, d, name): > > I think that even with nobranch param set you need to check that SHA-1 is > included, you just don't care in which branch if it's even included in > any. > > Something like > def _contains_ref(self, tag, branch, d): > was doing before 89abfbc1953e3711d6c90aff793ee622c22609b1, so the > conditional should be in _contains_ref not skipping it completely. > > > raise bb.fetch2.FetchError("Unable to find revision > > %s in branch %s even from upstream" % (ud.revisions[name], > > ud.branches[name])) > > > > def build_mirror_data(self, ud, d): > > -- > > 1.8.4.2 > > > > > > _______________________________________________ > > bitbake-devel mailing list > > bitbake-devel@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/bitbake-devel > > -- > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-07 10:47 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-07 3:21 [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA Zhenhua Luo 2014-01-07 8:34 ` Martin Jansa 2014-01-07 10:47 ` zhenhua.luo
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.