* [PATCH 0/1 V2] git.py: create a branch when checkout
@ 2015-07-09 7:18 Robert Yang
2015-07-09 7:18 ` [PATCH 1/1] " Robert Yang
0 siblings, 1 reply; 5+ messages in thread
From: Robert Yang @ 2015-07-09 7:18 UTC (permalink / raw)
To: bitbake-devel
* V2:
- Use upstream name
- Track remote branch
* V1:
- Initial version
// Robert
The following changes since commit 0aaa67a790ab211b35eed58173efa115ceb6e243:
oeqa/bbtests: Fix to ensure DL_DIR is set (2015-07-08 13:09:28 +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 | 7 +++++++
1 file changed, 7 insertions(+)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/1] git.py: create a branch when checkout 2015-07-09 7:18 [PATCH 0/1 V2] git.py: create a branch when checkout Robert Yang @ 2015-07-09 7:18 ` Robert Yang 2015-07-09 16:54 ` Paul Eggleton 0 siblings, 1 reply; 5+ messages in thread From: Robert Yang @ 2015-07-09 7:18 UTC (permalink / raw) To: bitbake-devel * Create a branch and named as upstream branch when checkout source * Set the branch to track remote branch. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- bitbake/lib/bb/fetch2/git.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 2e53882..afa3d0a 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -279,8 +279,15 @@ class Git(FetchMethod): if subdir != "": 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) + elif not ud.nobranch: + branchname = ud.branches[ud.names[0]] + runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, branchname, \ + ud.revisions[ud.names[0]]), d) + runfetchcmd("%s branch --set-upstream %s origin/%s" % (ud.basecmd, branchname, \ + branchname), d) else: runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d) + return True def clean(self, ud, d): -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] git.py: create a branch when checkout 2015-07-09 7:18 ` [PATCH 1/1] " Robert Yang @ 2015-07-09 16:54 ` Paul Eggleton 2015-07-10 0:00 ` Robert Yang 0 siblings, 1 reply; 5+ messages in thread From: Paul Eggleton @ 2015-07-09 16:54 UTC (permalink / raw) To: Robert Yang; +Cc: bitbake-devel On Thursday 09 July 2015 00:18:01 Robert Yang wrote: > * Create a branch and named as upstream branch when checkout source > * Set the branch to track remote branch. > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > --- > bitbake/lib/bb/fetch2/git.py | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py > index 2e53882..afa3d0a 100644 > --- a/bitbake/lib/bb/fetch2/git.py > +++ b/bitbake/lib/bb/fetch2/git.py > @@ -279,8 +279,15 @@ class Git(FetchMethod): > if subdir != "": > 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) > + elif not ud.nobranch: > + branchname = ud.branches[ud.names[0]] > + runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, > branchname, \ > + ud.revisions[ud.names[0]]), d) > + runfetchcmd("%s branch --set-upstream %s origin/%s" % > (ud.basecmd, branchname, \ > + branchname), d) Doesn't git checkout support a --track option so we could do this in one command rather than two? Cheers, Paul -- Paul Eggleton Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] git.py: create a branch when checkout 2015-07-09 16:54 ` Paul Eggleton @ 2015-07-10 0:00 ` Robert Yang 2015-07-10 9:04 ` Paul Eggleton 0 siblings, 1 reply; 5+ messages in thread From: Robert Yang @ 2015-07-10 0:00 UTC (permalink / raw) To: Paul Eggleton; +Cc: bitbake-devel On 07/10/2015 12:54 AM, Paul Eggleton wrote: > On Thursday 09 July 2015 00:18:01 Robert Yang wrote: >> * Create a branch and named as upstream branch when checkout source >> * Set the branch to track remote branch. >> >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> >> --- >> bitbake/lib/bb/fetch2/git.py | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py >> index 2e53882..afa3d0a 100644 >> --- a/bitbake/lib/bb/fetch2/git.py >> +++ b/bitbake/lib/bb/fetch2/git.py >> @@ -279,8 +279,15 @@ class Git(FetchMethod): >> if subdir != "": >> 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) >> + elif not ud.nobranch: >> + branchname = ud.branches[ud.names[0]] >> + runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, >> branchname, \ >> + ud.revisions[ud.names[0]]), d) >> + runfetchcmd("%s branch --set-upstream %s origin/%s" % >> (ud.basecmd, branchname, \ >> + branchname), d) > > Doesn't git checkout support a --track option so we could do this in one > command rather than two? I'm afraid that we can use --track here, the supported commands are: git checkout -b <branch> --track <remote>/<branch> or git checkout -b <branch> <start point> What we need is something like: git checkout -b <branch> --track <remote>/<branch> <start point> but git doesn't support this. // Robert > > Cheers, > Paul > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] git.py: create a branch when checkout 2015-07-10 0:00 ` Robert Yang @ 2015-07-10 9:04 ` Paul Eggleton 0 siblings, 0 replies; 5+ messages in thread From: Paul Eggleton @ 2015-07-10 9:04 UTC (permalink / raw) To: Robert Yang; +Cc: bitbake-devel On Friday 10 July 2015 08:00:35 Robert Yang wrote: > On 07/10/2015 12:54 AM, Paul Eggleton wrote: > > On Thursday 09 July 2015 00:18:01 Robert Yang wrote: > >> * Create a branch and named as upstream branch when checkout source > >> * Set the branch to track remote branch. > >> > >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > >> --- > >> > >> bitbake/lib/bb/fetch2/git.py | 7 +++++++ > >> 1 file changed, 7 insertions(+) > >> > >> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py > >> index 2e53882..afa3d0a 100644 > >> --- a/bitbake/lib/bb/fetch2/git.py > >> +++ b/bitbake/lib/bb/fetch2/git.py > >> > >> @@ -279,8 +279,15 @@ class Git(FetchMethod): > >> if subdir != "": > >> 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) > >> + elif not ud.nobranch: > >> + branchname = ud.branches[ud.names[0]] > >> + runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, > >> branchname, \ > >> + ud.revisions[ud.names[0]]), d) > >> + runfetchcmd("%s branch --set-upstream %s origin/%s" % > >> (ud.basecmd, branchname, \ > >> + branchname), d) > > > > Doesn't git checkout support a --track option so we could do this in one > > command rather than two? > > I'm afraid that we can use --track here, the supported commands are: > git checkout -b <branch> --track <remote>/<branch> > or > git checkout -b <branch> <start point> > > What we need is something like: > git checkout -b <branch> --track <remote>/<branch> <start point> > but git doesn't support this. Ah ok, fair enough - thanks for checking. Cheers, Paul -- Paul Eggleton Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-10 9:04 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-07-09 7:18 [PATCH 0/1 V2] git.py: create a branch when checkout Robert Yang 2015-07-09 7:18 ` [PATCH 1/1] " Robert Yang 2015-07-09 16:54 ` Paul Eggleton 2015-07-10 0:00 ` Robert Yang 2015-07-10 9:04 ` Paul Eggleton
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.