Skip to content

Instantly share code, notes, and snippets.

@natiginfo
Last active April 10, 2019 11:18
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 natiginfo/f0d0d0a17956a4c68fc44703b5c4d717 to your computer and use it in GitHub Desktop.
Save natiginfo/f0d0d0a17956a4c68fc44703b5c4d717 to your computer and use it in GitHub Desktop.
Shell script for generating release notes based on merge history from previous last tag to latest tag.
#!/bin/bash
FILE_NAME="release_notes.txt"
COMMIT_HASH_FOR_TAG_BEFORE_LAST=$(git rev-list --tags --skip=1 --max-count=1)
TAG_BEFORE_LAST=$(git describe --abbrev=0 --tags $COMMIT_HASH_FOR_TAG_BEFORE_LAST)
LAST_TAG=$(git describe --abbrev=0 --tags)
LOGS=$(git log $TAG_BEFORE_LAST..$LAST_TAG --pretty="* format:%s" --merges)
$(rm -rf $FILE_NAME)
echo -e "$LAST_TAG\n$LOGS" >> $FILE_NAME
#!/bin/bash
# Script for checking what work you have done singe last push
# Checks logs between origin and local
CURRENT_BRANCH_NAME=$(git branch | grep \* | cut -d ' ' -f2)
LOGS=$(git log origin/$CURRENT_BRANCH_NAME..$CURRENT_BRANCH_NAME --pretty="* format:%s")
echo "$LOGS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment