From d576d9ca3a5e852ccfb1506e2df9fc09a9e30f52 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 29 Oct 2021 11:08:29 +0100 Subject: bitbake: fetch2/git: Add a warning asking users to set a branch in git urls There is much uncertainty around what tools and hosting providers will do about default git branch naming in the future. To help ensure we can handle the various scenarios, we will make branch names required in SRC_URI. To start that process, show users a warning if it isn't set. This may also allow us to change the default at some point in the future. (Bitbake rev: 86a9c26828479be55865bcce72bcc7e12b93caa7) Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/fetch2/git.py') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 51b616bad7..4186295cdd 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -165,7 +165,10 @@ class Git(FetchMethod): ud.nocheckout = 1 ud.unresolvedrev = {} - branches = ud.parm.get("branch", "master").split(',') + branches = ud.parm.get("branch", "").split(',') + if branches == [""] and not ud.nobranch: + bb.warn("URL: %s does not set any branch parameter. The future default branch used by tools and repositories is uncertain and we will therefore soon require this is set in all git urls." % ud.url) + branches = ["master"] if len(branches) != len(ud.names): raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) -- cgit v1.2.3-54-g00ecf