Created
December 13, 2019 04:13
-
-
Save nasrulhazim/1c6b372101f098e28aa9fdbaf976ce12 to your computer and use it in GitHub Desktop.
Generate Change Log in CSV Format using git log
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/env bash | |
if [ $# -eq 0 ] | |
then | |
echo "Please supply the date. eg. 2019-01-01" | |
exit 1; | |
fi | |
SINCE=$1 | |
UNTIL=$2 | |
VERSION=$3 | |
if [ -z "$UNTIL" ] | |
then | |
UNTIL=$(date +'%Y-%m-%d') | |
fi | |
if [ -z "$VERSION" ] | |
then | |
VERSION=$SINCE-$UNTIL | |
fi | |
mkdir -p "storage/changelog" | |
git log --since=$SINCE --until=$UNTIL --no-merges --date=short --pretty=format:'%ad,%s,%an,%h' > storage/changelog/CHANGELOG-$VERSION.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment