| Mike Marchetti | 3a0fc42 | 2017-11-17 13:38:47 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | REPO_NAME=$(basename $(git config --get remote.origin.url) | cut -d'.' -f1) |
| 4 | # get the latest tag |
| Mike Marchetti | 3a0fc42 | 2017-11-17 13:38:47 -0500 | [diff] [blame] | 5 | TAG_START=$(git tag | sort -Vr | head -1) |
| Michael Marchetti | a3f638c | 2018-02-23 20:29:14 +0100 | [diff] [blame] | 6 | |
| 7 | head_tag_diff=$(git rev-list $TAG_START ^HEAD |wc -l) |
| 8 | if [ $head_tag_diff -eq 0 ]; then |
| 9 | # HEAD and latest tag intersect. Instead try and find a previous tag and use that as the start diff |
| 10 | TAG_END=$TAG_START |
| 11 | TAG_START=$(git tag | sort -Vr | head -2 | sort -V | head -1) |
| 12 | else |
| 13 | TAG_END="HEAD" |
| 14 | fi |
| 15 | |
| Mike Marchetti | 3a0fc42 | 2017-11-17 13:38:47 -0500 | [diff] [blame] | 16 | git pull --tags origin master &> /dev/null |
| 17 | echo "<h1>$REPO_NAME Changelog</h1>" |
| 18 | echo "<h2>tag: ${TAG_START} -> ${TAG_END}</h2>" |
| Mike Marchetti | 9c5a78d | 2017-11-19 11:31:34 -0500 | [diff] [blame] | 19 | git log --pretty=format:"<li> <a href=https://osm.etsi.org/gitweb/?p=osm/$REPO_NAME.git;a=commitdiff;h=%H>%h •</a> %s</li> " --reverse ${TAG_START}..${TAG_END} |