[bitbake-devel] [PATCH 1/1] git.py: create a branch when checkout
Richard Purdie
richard.purdie at linuxfoundation.org
Wed Jul 8 08:28:05 UTC 2015
On Wed, 2015-07-08 at 09:28 +0800, Robert Yang wrote:
>
> On 07/08/2015 12:56 AM, Paul Eggleton wrote:
> > On Tuesday 07 July 2015 16:17:42 Richard Purdie wrote:
> >> On Mon, 2015-07-06 at 18:33 -0700, Robert Yang wrote:
> >>> Create a branch named oebuild_SRCREV when checkout the source, this
> >>> makes debug easier than "(no branch)" when look into the source.
> >>>
> >>> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
> >>> ---
> >>>
> >>> bitbake/lib/bb/fetch2/git.py | 3 ++-
> >>> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> >>> index 2e53882..12087dd 100644
> >>> --- a/bitbake/lib/bb/fetch2/git.py
> >>> +++ b/bitbake/lib/bb/fetch2/git.py
> >>>
> >>> @@ -280,7 +280,8 @@ class Git(FetchMethod):
> >>> runfetchcmd("%s read-tree %s%s" % (ud.basecmd,
> >>> ud.revisions[ud.names[0]], readpathspec), d)
> >>> runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd,
> >>> d)
> >>>
> >>> else:
> >>> - runfetchcmd("%s checkout %s" % (ud.basecmd,
> >>> ud.revisions[ud.names[0]]), d) + runfetchcmd("%s checkout
> >>> %s -b oebuild_%s" % (ud.basecmd, \ +
> >>> ud.revisions[ud.names[0]], ud.revisions[ud.names[0]]), d)>
> >>> return True
> >>
> >> Would it not make more sense to set the branch to the upstream branch
> >> name here?
> >
> > I'd go one step further, use the upstream branch name and also set it to track
> > the remote branch as well.
>
> Hi Paul and RP,
>
> I'm afraid that the ud.revisions[ud.names[0]] which is SRCREV may
> not point to an upstream branch or tag, please ?
ud.revisions might not, but ud.branches should. I think you want
something like:
branchcmd = ""
if not ud.nobranch:
branchcmd = "-b %s" % ud.branches[ud.names[0]]
runfetchcmd("%s checkout %s %s" % (ud.basecmd, ud.revisions[ud.names[0]], branchcmd), d)
However as Paul notes, setting it to track the upstream remote branch
would also be ideal.
Cheers,
Richard
More information about the bitbake-devel
mailing list