Created
January 27, 2025 15:39
-
-
Save Sparkboxx/ec13332e88d0dddb188dacb317da8174 to your computer and use it in GitHub Desktop.
commit-sha.sh
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
echo `PWD` | |
shopt -s nullglob | |
for path in *; do | |
echo "" | |
echo "" | |
if [ -d "${path}" ]; then | |
echo "# ${path}" | |
dirname="$(basename "${path}")" | |
git_dir_name="${dirname}/.git" | |
if [ -d $git_dir_name ]; then | |
cd $dirname | |
git log -1 --format=%H > ../commit-${dirname}.txt | |
cd - | |
else | |
echo "${path} is not a GIT repository." | |
continue | |
fi; | |
else | |
echo "Skipping: ${path}" | |
continue | |
fi; | |
done | |
for file in commit-*; do echo "===== $file ====="; cat "$file"; done > report-commits.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment