Skip to content

checkoutSCM: scm: import: allow to select/filter specific files #657

Open

Description

@sixtyfourktec

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.

Activity

  1. rhubert commented on Aug 8, 2025

    @rhubert
    Contributor

    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...

  2. jkloetzke commented on Aug 8, 2025

    @jkloetzke
    Member

    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.

  3. 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
  4. rhubert commented on Aug 11, 2025

    @rhubert
    Contributor

    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...

  5. jkloetzke commented on Aug 11, 2025

    @jkloetzke
    Member

    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...

  6. added this to the 1.2 milestone on Dec 8, 2025
  7. removed this from the 1.2 milestone on Dec 27, 2025
  8. jkloetzke commented on Nov 15, 2026

    @jkloetzke
    Member

    Let me know what you think about #741. It should be able to select any conceivable subset of a directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions