dfetch-org / dfetch

Dependency fetcher
https://dfetch.rtfd.io/
MIT License
11 stars 4 forks source link

Add possibilty to exclude / ignore files #571

Closed ben-edna closed 10 months ago

ben-edna commented 10 months ago

Sometimes a project has some large subfolder you want to ignore, or certain files that are not interesting. Add a new field to project in manifest to list folders/files to be ignored:


  projects:
  - name: SomeFolderWithStuff
    repo-path: some-git
    ignore:
        - LargeFolderWithTests/
        - uninteresting.txt
        - LargeFolderWithTests/file_in_subfolder.txt

The file paths should be relative to the src: directory

Implementation would be different per vcs:

ben-edna commented 10 months ago

In git a similar concept is called .gitignore and in svn you can fetch an external using --ignore flag where files with a relative name are ignored

Given you have the following structure:

/parent_repository
  /trunk
    /my_project
  /external_project
    /trunk
      /subfolder
        unwanted_file.txt

In this case, the SVN external definition might look like this:

^/external_project/trunk/subfolder my_project --ignore unwanted_file.txt

When you run svn update in your /parent_repository/trunk, it will fetch the content of ^/external_project/trunk/subfolder into the my_project directory. The --ignore option applies to the content within the my_project directory, so it's relative to the root of the external's working copy.

My proposal would be to call the field ignore:

What do you think @jgeudens & @sach-edna ?