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: Simplify the validation of SHA-1 revisions
Date: Thu, 14 Apr 2022 20:20:36 +0000 [thread overview]
Message-ID: <a51df30aaebc4da1bb6c02f519ede9be@axis.com> (raw)
In-Reply-To: <083ca178f3da30a8f3f21c641606a7f5267b41b3.camel@linuxfoundation.org>
> -----Original Message-----
> From: Richard Purdie <richard.purdie@linuxfoundation.org>
> Sent: den 14 april 2022 18:28
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; bitbake-
> devel@lists.openembedded.org
> Subject: Re: [bitbake-devel] [PATCH] fetch2/git: Simplify the validation
> of SHA-1 revisions
>
> On Thu, 2022-04-14 at 17:42 +0200, Peter Kjellerstedt wrote:
> > Also correct two comments.
> >
> > Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> > ---
> > bitbake/lib/bb/fetch2/git.py | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> > index b3eb8248d0..90104ac383 100644
> > --- a/bitbake/lib/bb/fetch2/git.py
> > +++ b/bitbake/lib/bb/fetch2/git.py
> > @@ -248,9 +248,10 @@ class Git(FetchMethod):
> >
> > ud.setup_revisions(d)
> >
> > + sha1_re = re.compile(r'^[0-9a-f]{40}$')
>
> re.compile() is expensive so in general we should cache that or do it at
> the module top level...
Sure, I can move it to the module top level.
I based the use of re.compile() in that class on how it was done in
the _revision_key() function. Do you want me to move its slash_re as
well?
> Cheers,
>
> Richard
//Peter
prev parent reply other threads:[~2022-04-14 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 15:42 [PATCH] fetch2/git: Simplify the validation of SHA-1 revisions Peter Kjellerstedt
2022-04-14 16:27 ` [bitbake-devel] " Richard Purdie
2022-04-14 20:20 ` 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=a51df30aaebc4da1bb6c02f519ede9be@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.