Last active
March 12, 2019 22:20
-
-
Save palaniraja/2bb7d7d64eef279e683b43e19c56c555 to your computer and use it in GitHub Desktop.
Find all the files changed between two commits and cumulated commit messages per file
This file contains 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
<html><head><style>td{white-space: pre;}</style></head><body><table border=1> | |
<tr> | |
<td>File: (file1.txt)</td> | |
<td> | |
5755793 commit from master (correct this time) | |
322afb2 file 1 modified, and to be tagged as v1 | |
</td></tr> | |
<tr> | |
<td>File: (file2.txt)</td> | |
<td> | |
696e761 SHOULD NOT BE LISTED IN SCRIPT YYYYYYYYYYYY | |
d03794c file2 edited and file3 deleted | |
</td></tr> | |
<tr> | |
<td>File: (file3.txt)</td> | |
<td> | |
2f05397 file3 deleted finally in master branch | |
1f82866 file3 added after v2 tagged | |
d03794c file2 edited and file3 deleted | |
</td></tr> | |
<tr> | |
<td>File: (file4.txt)</td> | |
<td> | |
37c0754 multiline commit message line #1 multiline commit message line #2 multiline commit message line #3 multiline commit message line #4 | |
67aa4b2 feature branch added and file4 commited | |
</td></tr> | |
<tr> | |
<td>File: (file5.txt)</td> | |
<td> | |
36c8a98 file5 added in newfile | |
</td></tr> | |
</table></body></html> |
This file contains 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
#!/usr/bin | |
echo "Usage: $0 startCommitSHA startCommitSHA\n\n" | |
outputFile="out.html" | |
rm $outputFile && touch $outputFile | |
# 3b9aea39c7..37c07544408b | |
echo "Start from Commit SHA: $1\n" | |
echo "End at Commit SHA: $2" | |
`echo "<html><head><style>td{white-space: pre;}</style></head><body><table border=1>" >> $outputFile` | |
git log --pretty='format:' --name-only $1..$2 | sort -u | while read line | |
do | |
if [ -n "${line}" ]; then | |
`echo "<tr>" >> $outputFile` | |
`echo "<td>File: ($line)</td>" >> $outputFile` | |
`echo "<td>" >> $outputFile` | |
git log --pretty=oneline --abbrev-commit $1..$2 -- $line >> $outputFile | |
`echo "</td></tr>" >> $outputFile` | |
# --all --full-history | |
fi | |
done | |
`echo "</table></body></html>" >> $outputFile` | |
echo "\n\nSaved to $outputFile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample output from my test reppo