Set multiple sparse checkout paths in one command/job#1577
Set multiple sparse checkout paths in one command/job#15771 commit merged intoAzure:masterfrom benbp:benbp/sparse-checkout-path-improvement
Conversation
|
The following pipelines have been queued for testing: |
| git clone --no-checkout --filter=tree:0 git://github.com/${{ repo.Name }} . | ||
| git sparse-checkout init | ||
| git sparse-checkout set eng | ||
| $paths = ('${{ convertToJson(parameters.Paths) }}' | ConvertFrom-Json) -Join ' ' |
There was a problem hiding this comment.
Interesting pattern. We might be able to use this to move other things into inline loop in the script block instead of having many devops steps.
There was a problem hiding this comment.
Yes it's very useful. I could see some of our release configs being made much simpler this way (instead of iterating over artifacts).
|
Hello @azure-sdk! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
For pipelines with many paths (e.g. core ci), it can be annoying to have so many separate jobs show up in the UI, one for each path. Additionally, sometimes git tries to do garbage collection and it can take a lot longer to run many
git sparse-checkout addcommands as opposed to a single set command. This PR changes the behavior to parse the yaml paths parameter object into the script, and run a single command to set the sparse checkout paths. I useinvoke-expressionhere because otherwise powershell treats the space-separated string as a single parameter and it all ends up on the same line in the sparse checkout config file.