Bug 14185

Summary: Git 2.30.0 defaults to main
Product: [Build System, Metadata & Runtime] OE-Core Reporter: akuster <akuster808>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 3.3   
Target Milestone: 4.0 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description akuster 2021-01-11 14:35:32 UTC
The latest git no longer defaults to 'master', its now main.  Need to check what impact that may have on fetchers or other supporting routines.
Comment 1 akuster 2021-01-16 20:23:34 UTC
it appears the article I read may have been incorrect. The 2.30.0 sources still have "master" as the default.

What they are providing is a method to re-define the default branch either by:

config --global init.defaultBranch <name>

or 

"--initial-branch=<branch-name>"

What they are doing is providing advice on not to use "master".

What this leads now to think is maybe we don't assume the default is master. Maybe we should migrate to have a branch defined not mater what. This should avoid this issue all together.

We may want to add a warning if no branch is defined as a check. I think 120 ish recipes in core don't have branch defined.

I think the first step is to inform the community the intentions or preferred method when using git as a fetcher. I can send patches to add ';branch="master"'
then add a checker to issue a message if "branch" is not defined.
Comment 2 Randy MacLeod 2021-10-28 15:12:33 UTC
Need to add a warning if the branch isn't set.