bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/bb/tests/fetch.py: set initial branch
@ 2023-05-09 12:17 peter
  2023-05-11 15:55 ` [bitbake-devel] " Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: peter @ 2023-05-09 12:17 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Bergin, Peter, Peter Bergin, Peter Bergin

From: "Bergin, Peter" <Peter.Bergin@windriver.com>

If you have a host where the git config for initial branch
name is something else than 'master' the unittest will fail
as they assume the default branch name is 'master'. Fix this
by explicitly set the intial branch name at 'git init'.

Signed-off-by: Peter Bergin <peter.bergin@windriver.com>
Signed-off-by: Peter Bergin <peter@berginkonsult.se>
---
 lib/bb/tests/fetch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 532adb941..f71d0d10c 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -423,7 +423,7 @@ class FetcherTest(unittest.TestCase):
         return bb.process.run(cmd, cwd=cwd)[0]
 
     def git_init(self, cwd=None):
-        self.git('init', cwd=cwd)
+        self.git(['init', '--initial-branch=master'], cwd=cwd)
         if not self.git(['config', 'user.email'], cwd=cwd):
             self.git(['config', 'user.email', 'you@example.com'], cwd=cwd)
         if not self.git(['config', 'user.name'], cwd=cwd):
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH] lib/bb/tests/fetch.py: set initial branch
  2023-05-09 12:17 [PATCH] lib/bb/tests/fetch.py: set initial branch peter
@ 2023-05-11 15:55 ` Alexandre Belloni
  2023-05-11 20:27   ` Peter Bergin
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2023-05-11 15:55 UTC (permalink / raw)
  To: Peter Bergin; +Cc: bitbake-devel, Bergin, Peter

Hello,

This fails on the autobuilders:

https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/1397/steps/11/logs/stdio

error: unknown option `initial-branch=master'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]


On 09/05/2023 14:17:17+0200, Peter Bergin wrote:
> From: "Bergin, Peter" <Peter.Bergin@windriver.com>
> 
> If you have a host where the git config for initial branch
> name is something else than 'master' the unittest will fail
> as they assume the default branch name is 'master'. Fix this
> by explicitly set the intial branch name at 'git init'.
> 
> Signed-off-by: Peter Bergin <peter.bergin@windriver.com>
> Signed-off-by: Peter Bergin <peter@berginkonsult.se>
> ---
>  lib/bb/tests/fetch.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
> index 532adb941..f71d0d10c 100644
> --- a/lib/bb/tests/fetch.py
> +++ b/lib/bb/tests/fetch.py
> @@ -423,7 +423,7 @@ class FetcherTest(unittest.TestCase):
>          return bb.process.run(cmd, cwd=cwd)[0]
>  
>      def git_init(self, cwd=None):
> -        self.git('init', cwd=cwd)
> +        self.git(['init', '--initial-branch=master'], cwd=cwd)
>          if not self.git(['config', 'user.email'], cwd=cwd):
>              self.git(['config', 'user.email', 'you@example.com'], cwd=cwd)
>          if not self.git(['config', 'user.name'], cwd=cwd):
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#14769): https://lists.openembedded.org/g/bitbake-devel/message/14769
> Mute This Topic: https://lists.openembedded.org/mt/98782276/3617179
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH] lib/bb/tests/fetch.py: set initial branch
  2023-05-11 15:55 ` [bitbake-devel] " Alexandre Belloni
@ 2023-05-11 20:27   ` Peter Bergin
  2023-05-11 20:45     ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Bergin @ 2023-05-11 20:27 UTC (permalink / raw)
  To: alexandre.belloni; +Cc: bitbake-devel, Bergin, Peter

Hi,

On 2023-05-11 17:55, Alexandre Belloni via lists.openembedded.org wrote:
> Hello,
>
> This fails on the autobuilders:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/1397/steps/11/logs/stdio
>
> error: unknown option `initial-branch=master'
> usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]
>
Host is Ubuntu 20.04 and from what I found it is running git version 
2.25. The argument '--initial-branch' to 'git-init' was added in version 
2.28, some time mid 2020. That is most probably the root cause of the 
failure. My verification was done on Ubuntu 22.04 using git version 2.34.

The solution I can come up with at the moment is to do:

'git init'
'git checkout -b master'

Is it worth sending a v2 on that? Or do you see a better solution?

/Peter


> On 09/05/2023 14:17:17+0200, Peter Bergin wrote:
>> From: "Bergin, Peter" <Peter.Bergin@windriver.com>
>>
>> If you have a host where the git config for initial branch
>> name is something else than 'master' the unittest will fail
>> as they assume the default branch name is 'master'. Fix this
>> by explicitly set the intial branch name at 'git init'.
>>
>> Signed-off-by: Peter Bergin <peter.bergin@windriver.com>
>> Signed-off-by: Peter Bergin <peter@berginkonsult.se>
>> ---
>>   lib/bb/tests/fetch.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
>> index 532adb941..f71d0d10c 100644
>> --- a/lib/bb/tests/fetch.py
>> +++ b/lib/bb/tests/fetch.py
>> @@ -423,7 +423,7 @@ class FetcherTest(unittest.TestCase):
>>           return bb.process.run(cmd, cwd=cwd)[0]
>>   
>>       def git_init(self, cwd=None):
>> -        self.git('init', cwd=cwd)
>> +        self.git(['init', '--initial-branch=master'], cwd=cwd)
>>           if not self.git(['config', 'user.email'], cwd=cwd):
>>               self.git(['config', 'user.email', 'you@example.com'], cwd=cwd)
>>           if not self.git(['config', 'user.name'], cwd=cwd):
>> -- 
>> 2.34.1
>>
>>
>>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#14784): https://lists.openembedded.org/g/bitbake-devel/message/14784
> Mute This Topic: https://lists.openembedded.org/mt/98782276/3617552
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [peter@berginkonsult.se]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH] lib/bb/tests/fetch.py: set initial branch
  2023-05-11 20:27   ` Peter Bergin
@ 2023-05-11 20:45     ` Alexandre Belloni
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2023-05-11 20:45 UTC (permalink / raw)
  To: Peter Bergin; +Cc: bitbake-devel, Bergin, Peter

On 11/05/2023 22:27:28+0200, Peter Bergin wrote:
> Hi,
> 
> On 2023-05-11 17:55, Alexandre Belloni via lists.openembedded.org wrote:
> > Hello,
> > 
> > This fails on the autobuilders:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/1397/steps/11/logs/stdio
> > 
> > error: unknown option `initial-branch=master'
> > usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]
> > 
> Host is Ubuntu 20.04 and from what I found it is running git version 2.25.
> The argument '--initial-branch' to 'git-init' was added in version 2.28,
> some time mid 2020. That is most probably the root cause of the failure. My
> verification was done on Ubuntu 22.04 using git version 2.34.
> 
> The solution I can come up with at the moment is to do:
> 
> 'git init'
> 'git checkout -b master'
> 
> Is it worth sending a v2 on that? Or do you see a better solution?
> 

Well, this needs to work on all the autobuilder workers and this
currently includes ubuntu 18.04.

> /Peter
> 
> 
> > On 09/05/2023 14:17:17+0200, Peter Bergin wrote:
> > > From: "Bergin, Peter" <Peter.Bergin@windriver.com>
> > > 
> > > If you have a host where the git config for initial branch
> > > name is something else than 'master' the unittest will fail
> > > as they assume the default branch name is 'master'. Fix this
> > > by explicitly set the intial branch name at 'git init'.
> > > 
> > > Signed-off-by: Peter Bergin <peter.bergin@windriver.com>
> > > Signed-off-by: Peter Bergin <peter@berginkonsult.se>
> > > ---
> > >   lib/bb/tests/fetch.py | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
> > > index 532adb941..f71d0d10c 100644
> > > --- a/lib/bb/tests/fetch.py
> > > +++ b/lib/bb/tests/fetch.py
> > > @@ -423,7 +423,7 @@ class FetcherTest(unittest.TestCase):
> > >           return bb.process.run(cmd, cwd=cwd)[0]
> > >       def git_init(self, cwd=None):
> > > -        self.git('init', cwd=cwd)
> > > +        self.git(['init', '--initial-branch=master'], cwd=cwd)
> > >           if not self.git(['config', 'user.email'], cwd=cwd):
> > >               self.git(['config', 'user.email', 'you@example.com'], cwd=cwd)
> > >           if not self.git(['config', 'user.name'], cwd=cwd):
> > > -- 
> > > 2.34.1
> > > 
> > > 
> > > 
> > 
> > 
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#14784): https://lists.openembedded.org/g/bitbake-devel/message/14784
> > Mute This Topic: https://lists.openembedded.org/mt/98782276/3617552
> > Group Owner: bitbake-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [peter@berginkonsult.se]
> > -=-=-=-=-=-=-=-=-=-=-=-
> > 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-11 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09 12:17 [PATCH] lib/bb/tests/fetch.py: set initial branch peter
2023-05-11 15:55 ` [bitbake-devel] " Alexandre Belloni
2023-05-11 20:27   ` Peter Bergin
2023-05-11 20:45     ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).