blob: e2fa55e4557b6a147a8c28d733d66deff1284a3b [file] [log] [blame]
Mike Marchetti3a0fc422017-11-17 13:38:47 -05001#!/bin/bash
2
3REPO_NAME=$(basename $(git config --get remote.origin.url) | cut -d'.' -f1)
4# get the latest tag
Mike Marchetti3a0fc422017-11-17 13:38:47 -05005TAG_START=$(git tag | sort -Vr | head -1)
Michael Marchettia3f638c2018-02-23 20:29:14 +01006
7head_tag_diff=$(git rev-list $TAG_START ^HEAD |wc -l)
8if [ $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)
12else
13 TAG_END="HEAD"
14fi
15
Mike Marchetti3a0fc422017-11-17 13:38:47 -050016git pull --tags origin master &> /dev/null
17echo "<h1>$REPO_NAME Changelog</h1>"
18echo "<h2>tag: ${TAG_START} -> ${TAG_END}</h2>"
Mike Marchetti9c5a78d2017-11-19 11:31:34 -050019git log --pretty=format:"<li> <a href=https://osm.etsi.org/gitweb/?p=osm/$REPO_NAME.git;a=commitdiff;h=%H>%h &bull;</a> %s</li> " --reverse ${TAG_START}..${TAG_END}