Skip to contentSkip to conversation

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

PATCH In review Martin Jansa 2 participants 3 messages Oct 17, 2022 – Oct 26, 2022

lore
Share & tools
lore
#0 lore raw

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

* 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]

---
 lib/bb/fetch2/gitsm.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/fetch2/gitsm.py +1 -0
index 25d5db0e..36f0464c 100644
@@ -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
Signature · 1 line
2.38.0
#1 lore raw
Quoted 17 lines · Martin Jansa

* 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]

---
 lib/bb/fetch2/gitsm.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/fetch2/gitsm.py +0 -0
index 25d5db0e..36f0464c 100644

lib/bb/fetch2/gitsm.py class GitSM(Git): · line 128

Quoted 7 lines
lib/bb/fetch2/gitsm.py +1 -0
@@ -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

#2 lore raw

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/[email protected]/

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,

Quoted 39 lines · Richard Purdie
Quoted 3 lines · Martin Jansa

* 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

Quoted 14 lines

when LFS is enabled in gitconfig

[YOCTO #14938]

---
 lib/bb/fetch2/gitsm.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/fetch2/gitsm.py +0 -0
index 25d5db0e..36f0464c 100644

lib/bb/fetch2/gitsm.py class GitSM(Git): · line 128

Quoted 7 lines
lib/bb/fetch2/gitsm.py +1 -0
@@ -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