git release notes #git #awk #release #notes
#! /usr/bin/awk -f | |
BEGIN { | |
FS="\][ ]*[-]*[ ]*" | |
} | |
/^\[.*\]/ { | |
sub(/\[/, "", $1) | |
if (NR == 1) { | |
previous_commit_tag = $1 | |
commit_message = "\t- " $2 | |
print previous_commit_tag "\n" commit_message | |
next | |
} | |
commit_message = "\t- " $2 | |
commit_tag = $1 | |
if(previous_commit_tag != commit_tag) { | |
print"\n" commit_tag "\n" commit_message | |
} else { | |
print commit_message | |
} | |
previous_commit_tag = commit_tag | |
} | |
END {} |
#!/bin/bash | |
set -e | |
PAST_TAG=$(git describe --tags --abbrev=0) | |
REF=${1:-$PAST_TAG} | |
git log $REF..HEAD --pretty=format:"%s" | ./format_git_log |
This comment has been minimized.
This comment has been minimized.
TODO, first parse a git commit. template. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Usage
Put both scripts in same location.
Get formatted output from latest git tag to HEAD:
./git_release_notes.sh
Get formatter output from a give commit to HEAD:
./git_release_notes.sh COMMIT_HASH
Output
Process git log where commits have been written in the format. of:
[JIRA_TICKET_ID] COMMIT_MSG
or[JIRA_TICKET_ID] - COMMIT_MSG
If multiple lines have the same ticket id these will be summarized in a section like. this