diff mbox series

gitsm: pass lfs parameter from main repo to all its submodules

Message ID 20221017132026.88753-1-Martin.Jansa@gmail.com
State New
Headers show
Series gitsm: pass lfs parameter from main repo to all its submodules | expand

Commit Message

Martin Jansa Oct. 17, 2022, 1:20 p.m. UTC
* it might not be ideal in some cases where we might require LFS objects
  only in some of the submodules, but still better than no way to set
  lfs for submodules which causes git smudge issues in e.g. vulkan-samples
  when LFS is enabled in gitconfig

[YOCTO #14938]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 lib/bb/fetch2/gitsm.py | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Purdie Oct. 25, 2022, 2:21 p.m. UTC | #1
On Mon, 2022-10-17 at 15:20 +0200, Martin Jansa wrote:
> * it might not be ideal in some cases where we might require LFS objects
>   only in some of the submodules, but still better than no way to set
>   lfs for submodules which causes git smudge issues in e.g. vulkan-samples
>   when LFS is enabled in gitconfig
> 
> [YOCTO #14938]
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  lib/bb/fetch2/gitsm.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
> index 25d5db0e..36f0464c 100644
> --- a/lib/bb/fetch2/gitsm.py
> +++ b/lib/bb/fetch2/gitsm.py
> @@ -122,6 +122,7 @@ class GitSM(Git):
>              url += ';protocol=%s' % proto
>              url += ";name=%s" % module
>              url += ";subpath=%s" % module
> +            url += ";lfs=%s" % ud.parm.get("lfs", "1")
>  
>              ld = d.createCopy()
>              # Not necessary to set SRC_URI, since we're passing the URI to


Shouldn't that be:

ud.parm.get("lfs", "0")

i.e. default to off but pass if present?

Cheers,

Richard
Martin Jansa Oct. 26, 2022, 8:13 a.m. UTC | #2
Hi,

yes, that might be better default, but this change alone doesn't resolve
all issues with git-lfs still :(

as documented by added test:

https://patchwork.yoctoproject.org/project/bitbake/patch/20221018193746.3599845-1-Martin.Jansa@gmail.com/

I don't know what is expected behavior which would be reproducible (not
affected by user's .gitconfig and git-lfs installed or not-installed).

Regards,

On Tue, Oct 25, 2022 at 4:21 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Mon, 2022-10-17 at 15:20 +0200, Martin Jansa wrote:
> > * it might not be ideal in some cases where we might require LFS objects
> >   only in some of the submodules, but still better than no way to set
> >   lfs for submodules which causes git smudge issues in e.g.
> vulkan-samples
> >   when LFS is enabled in gitconfig
> >
> > [YOCTO #14938]
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> >  lib/bb/fetch2/gitsm.py | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
> > index 25d5db0e..36f0464c 100644
> > --- a/lib/bb/fetch2/gitsm.py
> > +++ b/lib/bb/fetch2/gitsm.py
> > @@ -122,6 +122,7 @@ class GitSM(Git):
> >              url += ';protocol=%s' % proto
> >              url += ";name=%s" % module
> >              url += ";subpath=%s" % module
> > +            url += ";lfs=%s" % ud.parm.get("lfs", "1")
> >
> >              ld = d.createCopy()
> >              # Not necessary to set SRC_URI, since we're passing the URI
> to
>
>
> Shouldn't that be:
>
> ud.parm.get("lfs", "0")
>
> i.e. default to off but pass if present?
>
> Cheers,
>
> Richard
>
diff mbox series

Patch

diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index 25d5db0e..36f0464c 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -122,6 +122,7 @@  class GitSM(Git):
             url += ';protocol=%s' % proto
             url += ";name=%s" % module
             url += ";subpath=%s" % module
+            url += ";lfs=%s" % ud.parm.get("lfs", "1")
 
             ld = d.createCopy()
             # Not necessary to set SRC_URI, since we're passing the URI to