Exclude .vsidx files from clean to avoid git prompts during build - #27758
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Updates Start-PSBuild -Clean in build.psm1 to avoid interactive git clean prompts when Visual Studio has .vsidx files locked, by excluding those files from the clean operation.
Changes:
- Add an exclusion for
.vs/**/*.vsidxduringStart-PSBuild -Clean. - Reformat the
git cleaninvocation into a multi-line command with explicit excludes. - Adjust
git cleanflags (currently changes behavior from-fdXto-dx --force).
| git clean -dX --force ` | ||
| --exclude .vs/**/*.vsidx ` | ||
| --exclude src/Modules/nuget.config ` | ||
| --exclude .vs/PowerShell/v16/Server/sqlite3 ` | ||
| --exclude nuget.config |
There was a problem hiding this comment.
We strongly discourage use of backticks (even though they are supported) because they are hard to see & have caused plenty of issues in the past
please update this to using splatting
(although this doc needs updating to add splatting to Native Executables & an issue for that has been raised)
| git clean -dX --force ` | |
| --exclude .vs/**/*.vsidx ` | |
| --exclude src/Modules/nuget.config ` | |
| --exclude .vs/PowerShell/v16/Server/sqlite3 ` | |
| --exclude nuget.config | |
| $gitArgs = @( | |
| 'clean' | |
| '-dX' | |
| '--force' | |
| '--exclude=.vs/**/*.vsidx' | |
| '--exclude=src/Modules/nuget.config' | |
| '--exclude=.vs/PowerShell/v16/Server/sqlite3' | |
| '--exclude=nuget.config' | |
| ) | |
| git --% @gitArgs |
There was a problem hiding this comment.
you should double check that suggestion is right as I asked copliot.microsoft.com to give them to me & like all AI's they can be wrong from time to time
|
Ryan Yates (@kilasuit) Never mind. The fix doesn't really work. |
Closes #27745
PR Summary
Ignore .vsidx files during clean to avoid git prompts if the files are locked by Visual Studio.
PR Context
See #27745
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header