Created
September 19, 2016 19:15
-
-
Save n8gray/233f728f6b42c94ad6c28cb55044749f to your computer and use it in GitHub Desktop.
Shows a list of submodules that exist at the given commit, along with their corresponding submodule commits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ $# != 1 ]]; then | |
echo "usage: $0 SHA" | |
echo " Shows a list of submodules that exist at the given commit, along with their corresponding" | |
echo " submodule commits." | |
exit 1 | |
else | |
SHA=$1 | |
fi | |
# Look through the entire tree of the commit and filter out submodules by permission bits | |
git ls-tree --full-tree -r $SHA | grep '^160000' | cut -d ' ' -f '3-' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment