Find directories that had changes between commits

Viewed 867

I am setting up a jenkins job which iterates over the directories in a project, and performs similar actions inside each of them.

While, for now, since I have a small number of directories, going over all of them is not a big deal. But I'd like to only iterate over the directories which had changes made inside them between the GIT_PREVIOUS_COMMIT and GIT_COMMIT.

What my current job does:

for dir in */
do
  cd $dir
  # test a script exists
  # execute the script
  # upload the result.zip to an S3 bucket
  cd ..
done
2 Answers
Related