Skip to content

Instantly share code, notes, and snippets.

@jtbonhomme
Last active December 19, 2015 06:39
Show Gist options
  • Save jtbonhomme/5912651 to your computer and use it in GitHub Desktop.
Save jtbonhomme/5912651 to your computer and use it in GitHub Desktop.
edit commits between current tag and last tag
#!/bin/bash
LAST_TAG=`git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags|tail -1`
echo "# CHANGELOG "$LAST_TAG > CHANGELOG.tmp; DELTA=""
for i in `git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags|tail -2`
do DELTA=$DELTA".."$i
done
DELTA=`echo $DELTA|sed 's/^..//g'`
echo "" >> CHANGELOG.tmp
echo "## Commits between $DELTA">> CHANGELOG.tmp
echo "" >> CHANGELOG.tmp
git log $DELTA --pretty=format:"* %s%d (%an - %ad)" --date=short >> CHANGELOG.tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment