I've got a repo structure like this:
main/
├── bicep/
│ └── modules/
│ ├── module1/
│ │ └── .tests/
│ │ └── main.bicep
│ └── main.bicep
└── main.bicep
I'm trying to run a git diff
to only tell me what module files have been edited, with an extension of *.bicep, but exclude the .tests subfolder.
There will be a tests folder per module created.
My issue is I cannot seem to get git diff to even respect the folder I'm pointing it to using:
git diff HEAD HEAD~ --name-only -- *.bicep bicep/modules/
It will pick up commit changes under bicep/ and anywhere else however, I'm just trying to find a way to only check specifically under the /modules folder & exclude .tests folders, and only *.bicep extensions.
Running my current git diff command is picking up more than I'd like
PS C:\Repos\Lab> git diff HEAD HEAD~ --name-only -- *.bicep bicep/modules/
Bicep/main.bicep
Bicep/modules/storage/.tests/main.tests.bicep
Bicep/modules/storage/main.bicep
I can exclude a folder by adding
':!folder'
but my tests folder is in a subfolder and main.bicep file from the main Bicep folder.
Any ideas?
Thanks!