get a list of all 1st level directories impacted by recent commits for a git monorepo
问题 I am currently playing with monorepos and I am trying to retrieve a list all 1 level subfolders in the repo which are impacted since a given commit. So far I can retrieve all the files impacted using git diff --name-only $COMMIT_ID..head Using git diff --name-only $COMMIT_ID..head | xargs -L1 dirname I manage to get only the folder names. To remove all the duplicates I added sort | uniq to the mix: git diff --name-only $COMMIT_ID..head | xargs -L1 dirname | sort | uniq All I need now is to