Add input parameter filter for git commands #3595
Merged
+246
−100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new input parameter
filter
to assist in working with large git projects. The param filter sets the git filter-spec argument when fetching repositories. Only one argument can be provided, the combined form can be used to set multiple filters. When using filter combined with asubdir
the checkout will now also be sparse to further reduce the number of workspace files.The documentation for filter arguments can be found in the
git rev-list
command: https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---filterltfilter-specgtSee this blog post on the different filter checkouts that may be used: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
As an example using the envoy project as a larger repository, it can be built using the new filter argument:
Which reduces the fetch of the git repository from 10.6s to 2.6s.