Skip to content

Instantly share code, notes, and snippets.

@mcjwsk
Last active January 30, 2017 21:12
Show Gist options
  • Save mcjwsk/45368174f1a4fdca81bc32745c6048cc to your computer and use it in GitHub Desktop.
Save mcjwsk/45368174f1a4fdca81bc32745c6048cc to your computer and use it in GitHub Desktop.
#!/bin/bash
base_dir="$PWD"
changed_modules=$(git submodule summary | grep '^*' | cut -d ' ' -f 2,3)
echo "$changed_modules" | while read dir commits; do
cd "$dir"
git diff --name-only "$commits" | sed -e "s#^#$dir/#g"
cd "$base_dir"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment