Skip to content

Instantly share code, notes, and snippets.

@kakra
Created April 8, 2018 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kakra/31d88f05f80e6240e502624077ec6304 to your computer and use it in GitHub Desktop.
Save kakra/31d88f05f80e6240e502624077ec6304 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
COMMIT=${1:-HEAD}
VERSIONS=$(git tag --list --sort -v:refname --no-contains ${COMMIT})
SINCE=$(head -1 <<<${VERSIONS})
SINCE=${SINCE:-$(git rev-list --max-parents=0 HEAD)}
cat <<-SUBJECT
Changes since ${SINCE} up to ${COMMIT}
SUBJECT
HEADLINES=$(git log --no-merges --pretty=format:"%s" -E --grep "#[0-9]+" --grep "#headline" ${SINCE}..${COMMIT} | sort -u | awk '{ print " * " $0 }')
if [ -n "${HEADLINES}" ]; then
cat <<-HEADLINES
Headlines:
${HEADLINES}
HEADLINES
fi
git shortlog -n --no-merges ${SINCE}..${COMMIT} | cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment