Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
Created December 13, 2019 04:13
Show Gist options
  • Save nasrulhazim/1c6b372101f098e28aa9fdbaf976ce12 to your computer and use it in GitHub Desktop.
Save nasrulhazim/1c6b372101f098e28aa9fdbaf976ce12 to your computer and use it in GitHub Desktop.
Generate Change Log in CSV Format using git log
#!/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