Skip to content

Instantly share code, notes, and snippets.

@Hammond95
Created March 8, 2019 17:31
Show Gist options
  • Save Hammond95/f626bd13f33579cc36bc2a994f395943 to your computer and use it in GitHub Desktop.
Save Hammond95/f626bd13f33579cc36bc2a994f395943 to your computer and use it in GitHub Desktop.
Having a file which keeps the version of the project, automatically generates a changelog.md like file containing the info about commits between versions.
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COMMITS_VERSIONS=$(git log --follow -- "${SCRIPTDIR}/../VERSION" | grep -E '^commit' | sed 's#commit ##g')
NEXT=$(echo -e "$COMMITS_VERSIONS" | head -1)
COMMITS_VERSIONS=$(echo -e "$COMMITS_VERSIONS" | tail -n+2)
for commit in $COMMITS_VERSIONS; do
VERSION=$(git show ${NEXT}:../pycuebiq/VERSION)
echo -e "${VERSION}\n----------------\n"
COMMENTS=$(git log ${commit}...${NEXT})
echo -e "${COMMENTS}\n"
NEXT=${commit}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment