Last active
August 5, 2020 23:31
-
-
Save DanielCardonaRojas/cf861172f4c9084575c6729921720e08 to your computer and use it in GitHub Desktop.
git release notes #git #awk #release #notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO, first parse a git commit. template.