All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	"bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: RE: [bitbake-devel] [PATCH] fetch2/git: Add a warning asking users to set a branch in git urls
Date: Fri, 29 Oct 2021 18:49:55 +0000	[thread overview]
Message-ID: <f8e3d52f7f03496e81dab1693de88527@axis.com> (raw)
In-Reply-To: <20211029125759.3422953-1-richard.purdie@linuxfoundation.org>

> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-
> devel@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 29 oktober 2021 14:58
> To: bitbake-devel@lists.openembedded.org
> Subject: [bitbake-devel] [PATCH] 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.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  lib/bb/fetch2/git.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 51b616bad7..17a7927e52 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/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 == [""]:
> +            bb.warn("URL: %s does not have any branch set. The
> uncertainty around the default branch used by tools and repositories means
> we will soon require this in all git urls so please add it." % 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)
> 
> --
> 2.32.0

What about nobranch=1? We use that for all our Git recipes (~1500). I would 
really hate to have to add branch=master to all of them when we really do 
not care about what branch the SRCREV happens to be on (especially as it 
often is a Gerrit review reference).

//Peter



      parent reply	other threads:[~2021-10-29 18:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 12:57 [PATCH] fetch2/git: Add a warning asking users to set a branch in git urls Richard Purdie
2021-10-29 13:00 ` [bitbake-devel] " Robert P. J. Day
2021-10-29 18:49 ` Peter Kjellerstedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8e3d52f7f03496e81dab1693de88527@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.