Skip to content

Instantly share code, notes, and snippets.

@gilesdring
Last active October 14, 2016 13:04
Show Gist options
  • Save gilesdring/5eea5b39b41282be3345f64a6e77324f to your computer and use it in GitHub Desktop.
Save gilesdring/5eea5b39b41282be3345f64a6e77324f to your computer and use it in GitHub Desktop.
Automatically prepending to CHANGELOG.md
#!/usr/bin/env bash
# Deal with case that we're on the initial commit
[[ $(git rev-parse HEAD) == $(git rev-list --max-parents=0 HEAD) ]] || PARENT="HEAD^.."
cat <(git log ${PARENT}HEAD --format=format:'# %s - %h - %ai%n%n%b%n') CHANGELOG.md > CHANGELOG.tmp
mv CHANGELOG.tmp CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment