You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
checkoutSCM: scm: import: allow to select/filter specific files #657
It would be nice if I could select one (or more) files from an import directory for the file import checkout step. Sometimes I need just one file (like a defconfig) and I always have to create a directory for it. If I put them all into one directory and import that src directory into multiple packages, all of them get rebuild if one of those files is changed.
Maybe this can be done more generic, not limited to the import scm? I've a large mono-repo project which is split by the recipe into many packages. For each of the package only a single folder of the repo is needed, so some kind of filtering would also be nice there...
Maybe this can be done more generic, not limited to the import scm?
Not sure how this is going to work in general. If we tell git to checkout a repository it will checkout the whole tree. I'm afraid this must be implemented by each SCM individually.
Maybe this can be done more generic, not limited to the import scm? I've a large mono-repo project which is split by the recipe into many packages. For each of the package only a single folder of the repo is needed, so some kind of filtering would also be nice there...
We could add support for git-sparse-checkout. But the manpage states that this is an experimental feature to this day. I wouldn't be too comfortable to add this. OTOH, if it helps your use case, I wouldn't reject it either.
changed the title [-]checkoutSCM: scm: import: allow to select/filter specific files #110[/-][+]checkoutSCM: scm: import: allow to select/filter specific files[/+]on Aug 8, 2025
Well - If it were easy, I would have already implemented it. :) I had the rough idea to use some sandbox-mount magic to make only some folders visible to the buildStep and to exclude all others from the source hashing. But this would only work on folder level, not on file level. And it would break the buildIds for binary artifacts...
But using mount namespaces is not always feasible (Windows, user namespaces disabled, ...). So I would not go this route to begin with. (BTW, you can bind mount files. So it would work also with single files.)
Adding it selectively to SCMs where possible is a different thing...
Activity
rhubert commentedon Aug 8, 2025
Maybe this can be done more generic, not limited to the import scm? I've a large mono-repo project which is split by the recipe into many packages. For each of the package only a single folder of the repo is needed, so some kind of filtering would also be nice there...
jkloetzke commentedon Aug 8, 2025
Not sure how this is going to work in general. If we tell git to checkout a repository it will checkout the whole tree. I'm afraid this must be implemented by each SCM individually.
We could add support for git-sparse-checkout. But the manpage states that this is an experimental feature to this day. I wouldn't be too comfortable to add this. OTOH, if it helps your use case, I wouldn't reject it either.
[-]checkoutSCM: scm: import: allow to select/filter specific files #110[/-][+]checkoutSCM: scm: import: allow to select/filter specific files[/+]rhubert commentedon Aug 11, 2025
Well - If it were easy, I would have already implemented it. :) I had the rough idea to use some sandbox-mount magic to make only some folders visible to the
buildStepand to exclude all others from the source hashing. But this would only work on folder level, not on file level. And it would break the buildIds for binary artifacts...jkloetzke commentedon Aug 11, 2025
But using mount namespaces is not always feasible (Windows, user namespaces disabled, ...). So I would not go this route to begin with. (BTW, you can bind mount files. So it would work also with single files.)
Adding it selectively to SCMs where possible is a different thing...
jkloetzke commentedon Nov 15, 2026
Let me know what you think about #741. It should be able to select any conceivable subset of a directory.