git.py: create a branch when checkout
cover git.py: create a branch when checkout
The following changes since commit 7a402301c9c8fa9a5262d6d29b2ea199ff0dc07a:
distro/package_regex.inc: Use GNOME_STABLE rule for vala (2015-07-02 23:08:41 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib rbt/git
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/git
Robert Yang (1):
git.py: create a branch when checkout
bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
PATCH 1/1 git.py: create a branch when checkout
Create a branch named oebuild_SRCREV when checkout the source, this makes debug easier than "(no branch)" when look into the source.
--- bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/git.py +2 -1
@@ -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 def clean(self, ud, d):
Signature · 1 line
1.7.9.5
Quoted 13 lines · Robert Yang
Create a branch named
oebuild_SRCREVwhen checkout the source, this makes debug easier than "(no branch)" when look into the source.Signed-off-by Robert Yang <[email protected]>--- bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)bitbake/lib/bb/fetch2/git.py +0
-0
bitbake/lib/bb/fetch2/git.py class Git(FetchMethod): · line 285
Quoted 7 lines
bitbake/lib/bb/fetch2/git.py +2
-1@@ -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?
Cheers,
Richard
Quoted 21 lines · On Tuesday 07 July 2015 16:17:42 Richard Purdie wrote:
Quoted 20 lines · Robert Yang
Create a branch named
oebuild_SRCREVwhen checkout the source, this makes debug easier than "(no branch)" when look into the source.Signed-off-by Robert Yang <[email protected]>---
bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)bitbake/lib/bb/fetch2/git.py +0
-0@@ -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)
Quoted 9 lines
Quoted 6 lines
bitbake/lib/bb/fetch2/git.py +0
-1else: - 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 TrueWould 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.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Quoted 32 lines · Paul Eggleton
Quoted 21 lines · On Tuesday 07 July 2015 16:17:42 Richard Purdie wrote:
Quoted 20 lines · Robert Yang
Create a branch named
oebuild_SRCREVwhen checkout the source, this makes debug easier than "(no branch)" when look into the source.Signed-off-by Robert Yang <[email protected]>---
bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)bitbake/lib/bb/fetch2/git.py +0
-0@@ -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)Quoted 9 lines
Quoted 6 lines
bitbake/lib/bb/fetch2/git.py +0
-1else: - 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 TrueWould it not make more sense to set the branch to the upstream branch name here?
Quoted 2 lines
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 ?
// Robert
Quoted 4 lines
Cheers,
Paul
Quoted 34 lines · Robert Yang
Quoted 32 lines · Paul Eggleton
Quoted 30 lines · On Tuesday 07 July 2015 16:17:42 Richard Purdie wrote:
Quoted 22 lines · Robert Yang
Create a branch named
oebuild_SRCREVwhen checkout the source, this makes debug easier than "(no branch)" when look into the source.Signed-off-by Robert Yang <[email protected]>---
bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)bitbake/lib/bb/fetch2/git.py +0
-1@@ -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,Quoted 4 lines
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 TrueWould it not make more sense to set the branch to the upstream branch name here?
Quoted 7 lines
Quoted 2 lines
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
Thanks, I will send a V2.
// Robert
Quoted 60 lines · Richard Purdie
Quoted 34 lines · Robert Yang
Quoted 32 lines · Paul Eggleton
Quoted 30 lines · On Tuesday 07 July 2015 16:17:42 Richard Purdie wrote:
Quoted 22 lines · Robert Yang
Create a branch named
oebuild_SRCREVwhen checkout the source, this makes debug easier than "(no branch)" when look into the source.Signed-off-by Robert Yang <[email protected]>---
bitbake/lib/bb/fetch2/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)bitbake/lib/bb/fetch2/git.py +0
-1@@ -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,Quoted 4 lines
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 TrueWould it not make more sense to set the branch to the upstream branch name here?
Quoted 7 lines
Quoted 2 lines
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