Created
November 18, 2014 23:35
-
-
Save miguelramos/a1a6f518430dda35f876 to your computer and use it in GitHub Desktop.
Bash Script for Group git log and writes to CHANGELOG.MD
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
#!/bin/bash | |
AUTHOR=$(git config user.name) | |
DATE=$(date +%F) | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
FILE="$DIR/CHANGELOG.MD" | |
echo "#CHANGELOG ON" $DATE > $FILE | |
git log --no-merges --format="%cd" --date=short --no-merges --author="$AUTHOR" --all | sort -u -r | while read DATE ; do | |
if [[ $NEXT != "" ]] | |
then | |
echo >> $FILE | |
echo "###" $NEXT >> $FILE | |
fi | |
GIT_PAGER=cat git log --no-merges --format=" - %s" --since=$DATE --until=$NEXT --author="$AUTHOR" --all >> $FILE | |
NEXT=$DATE | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment