Bug 14185 - Git 2.30.0 defaults to main
Summary: Git 2.30.0 defaults to main
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 3.3
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 4.0 M1
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2021-01-11 14:35 UTC by akuster
Modified: 2021-11-03 12:11 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.