|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This CHANGELOG script was originally based of the work of Andrey Nikishaev and Gunnar Lindholm from this post: |
| 4 | +# http://stackoverflow.com/questions/7387612/git-changelog-how-to-get-all-changes-up-to-a-specific-tag |
| 5 | + |
| 6 | +# This script is geared towards OSX and you will need GTAC installed. |
| 7 | +# `brew install coreutils` |
| 8 | + |
| 9 | +# The placeholders are: |
| 10 | + |
| 11 | +# %H: commit hash |
| 12 | +# %h: abbreviated commit hash |
| 13 | +# %T: tree hash |
| 14 | +# %t: abbreviated tree hash |
| 15 | +# %P: parent hashes |
| 16 | +# %p: abbreviated parent hashes |
| 17 | +# %an: author name |
| 18 | +# %aN: author name (respecting .mailmap) |
| 19 | +# %ae: author email |
| 20 | +# %aE: author email (respecting .mailmap) |
| 21 | +# %ad: author date (format respects --date= option) |
| 22 | +# %aD: author date, RFC2822 style |
| 23 | +# %ar: author date, relative |
| 24 | +# %at: author date, UNIX timestamp |
| 25 | +# %ai: author date, ISO 8601 format |
| 26 | +# %cn: committer name |
| 27 | +# %cN: committer name (respecting .mailmap) |
| 28 | +# %ce: committer email |
| 29 | +# %cE: committer email (respecting .mailmap) |
| 30 | +# %cd: committer date |
| 31 | +# %cD: committer date, RFC2822 style |
| 32 | +# %cr: committer date, relative |
| 33 | +# %ct: committer date, UNIX timestamp |
| 34 | +# %ci: committer date, ISO 8601 format |
| 35 | +# %d: ref names, like the --decorate option of git-log(1) |
| 36 | +# %e: encoding |
| 37 | +# %s: subject |
| 38 | +# %f: sanitized subject line, suitable for a filename |
| 39 | +# %b: body |
| 40 | +# %B: raw body (unwrapped subject and body) |
| 41 | +# %N: commit notes |
| 42 | +# %gD: reflog selector, e.g., refs/stash@{1} |
| 43 | +# %gd: shortened reflog selector, e.g., stash@{1} |
| 44 | +# %gn: reflog identity name |
| 45 | +# %gN: reflog identity name (respecting .mailmap) |
| 46 | +# %ge: reflog identity email |
| 47 | +# %gE: reflog identity email (respecting .mailmap) |
| 48 | +# %gs: reflog subject |
| 49 | + |
| 50 | +repo_url="http://github.com/kandanapp/kandan/commit/" |
| 51 | + |
| 52 | +echo "CHANGELOG" |
| 53 | +echo "=========" |
| 54 | +git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags |gtac |grep -v '^$' | while read TAG ; do |
| 55 | + echo |
| 56 | + if [ $NEXT ];then |
| 57 | + echo "#### [$NEXT]" |
| 58 | + else |
| 59 | + echo "#### [Current]" |
| 60 | + fi |
| 61 | + GIT_PAGER=cat git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" $TAG..$NEXT |
| 62 | + NEXT=$TAG |
| 63 | +done |
| 64 | +echo "" |
| 65 | +FIRST=$(git tag -l | head -1) |
| 66 | +echo "" |
| 67 | + |
| 68 | +echo "#### [$FIRST]" |
| 69 | + |
| 70 | +GIT_PAGER=cat git log --pretty=format:" * [%h]($repo_url%h) %s __(%an)__" $FIRST |
0 commit comments