[bitbake-devel,1/3] git.py: skip smudging if lfs=0 is set

Submitted by Mauro Queirós on May 28, 2020, 2:18 p.m. | Patch ID: 172928

Details

Message ID 20200528141853.213890-1-maurofrqueiros@gmail.com
State Master Next
Commit e9540ec13d6879dbf567e730c8af2b3369a17c1b
Headers show

Commit Message

Mauro Queirós May 28, 2020, 2:18 p.m.
Git-LFS objects were being fetched even when lfs=0 was not set.
This patch disables LFS smudging when lfs=0. That way, only the LFS pointers
are downloaded during checkout.

Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
---
 lib/bb/fetch2/git.py | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 5b3793a7..4c7d388e 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -475,6 +475,9 @@  class Git(FetchMethod):
 
         need_lfs = ud.parm.get("lfs", "1") == "1"
 
+        if not need_lfs:
+            ud.basecmd = "GIT_LFS_SKIP_SMUDGE=1 " + ud.basecmd
+
         source_found = False
         source_error = []
 

Comments

Richard Purdie May 29, 2020, 5:46 a.m.
On Thu, 2020-05-28 at 15:18 +0100, Mauro Queirós wrote:
> Git-LFS objects were being fetched even when lfs=0 was not set.
> This patch disables LFS smudging when lfs=0. That way, only the LFS
> pointers
> are downloaded during checkout.
> 
> Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
> ---
>  lib/bb/fetch2/git.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 5b3793a7..4c7d388e 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -475,6 +475,9 @@ class Git(FetchMethod):
>  
>          need_lfs = ud.parm.get("lfs", "1") == "1"
>  
> +        if not need_lfs:
> +            ud.basecmd = "GIT_LFS_SKIP_SMUDGE=1 " + ud.basecmd
> +
>          source_found = False
>          source_error = []

Thanks for the patches, the sound good. Unfortunately they cause
bitbake-selftest to fail:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/991/steps/8/logs/step1d

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11337): https://lists.openembedded.org/g/bitbake-devel/message/11337
Mute This Topic: https://lists.openembedded.org/mt/74522486/3617530
Group Owner: bitbake-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Mauro Queirós May 29, 2020, 10:12 a.m.
That's because I was using .lfsconfig instead of .gitattributes in
"contains_lfs" function. self-tests only use the latter.
I've send v2 patches.

Richard Purdie <richard.purdie@linuxfoundation.org> escreveu no dia sexta,
29/05/2020 à(s) 06:46:

> On Thu, 2020-05-28 at 15:18 +0100, Mauro Queirós wrote:
> > Git-LFS objects were being fetched even when lfs=0 was not set.
> > This patch disables LFS smudging when lfs=0. That way, only the LFS
> > pointers
> > are downloaded during checkout.
> >
> > Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
> > ---
> >  lib/bb/fetch2/git.py | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> > index 5b3793a7..4c7d388e 100644
> > --- a/lib/bb/fetch2/git.py
> > +++ b/lib/bb/fetch2/git.py
> > @@ -475,6 +475,9 @@ class Git(FetchMethod):
> >
> >          need_lfs = ud.parm.get("lfs", "1") == "1"
> >
> > +        if not need_lfs:
> > +            ud.basecmd = "GIT_LFS_SKIP_SMUDGE=1 " + ud.basecmd
> > +
> >          source_found = False
> >          source_error = []
>
> Thanks for the patches, the sound good. Unfortunately they cause
> bitbake-selftest to fail:
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/991/steps/8/logs/step1d
>
> Cheers,
>
> Richard
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11341): https://lists.openembedded.org/g/bitbake-devel/message/11341
Mute This Topic: https://lists.openembedded.org/mt/74522486/3617530
Group Owner: bitbake-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-