From: Stefan Bund Date: Thu, 12 Nov 2009 14:33:13 +0000 (+0100) Subject: Use tagger not commiter in debian/changelog X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=3136c315366163ca395d3489a4770ba64b014698;p=mapsector.git Use tagger not commiter in debian/changelog --- diff --git a/Makefile b/Makefile index ad1a9fe..8d18970 100644 --- a/Makefile +++ b/Makefile @@ -24,27 +24,31 @@ CHANGELOGS := $(shell lasttag=HEAD; \ lasttag=$$tag; \ done) +# Author/Date formating could as simple as git log --format=' -- %an <%ae> %cD' +# however, we want the tagger not the author and git log doesn't show tags, only commits ... $(CHANGELOGS): %: @echo "generating $@" @mkdir -p "$(CLOGDIR)" - @( \ - set -e; \ - version="$@"; version="$${version#$(CLOGDIR)/}"; \ - from="$${version%-*}"; version="$${version#*-}"; to="$$version"; \ - if [ "$$from" == "$$to" ]; then from=""; fi; \ - release="unstable"; \ - if [ "$$version" == "HEAD" ]; then \ - version="`git describe --tag --match='v*' | sed -e 's/-/~/' -e 's/-/./g'`"; \ - release="UNRELEASED"; \ - fi; \ - version="$${version#v}"; \ - echo "$(NAME) ($$version) $$release; urgency=low"; \ - echo; \ - git log --pretty=oneline --abbrev-commit $$from$${from:+..}$$to \ - | while read commit description; do \ - echo " * [$$commit] $$description"; \ - done; \ - git log --format='%n -- %an <%ae> %cD%n' $$to'^!'; \ + @( \ + version="$@"; version="$${version#$(CLOGDIR)/}"; \ + from="$${version%-*}"; version="$${version#*-}"; to="$$version"; \ + if [ "$$from" == "$$to" ]; then from=""; fi; \ + release="unstable"; \ + if [ "$$version" == "HEAD" ]; then \ + version="`git describe --tag --match='v*' | sed -e 's/-/~/' -e 's/-/./g'`"; \ + release="UNRELEASED"; \ + fi; \ + version="$${version#v}"; \ + echo "$(NAME) ($$version) $$release; urgency=low"; \ + echo; \ + git log --format=' * [%h] %s' $$from$${from:+..}$$to; \ + date="`echo $$to | git cat-file --batch \ + | sed -n \ + -e 's/^\(tagger\|committer\) \(.*\)00$$/\2/' \ + -eT -e 'y/+-/-+/' -ep`"; \ + author="$${date% * *}"; date="$${date#$$author }"; zone="$${date#* }"; \ + date="`TZ="UTC$$zone" date -d "1/1/1970 0:0 UTC + $${date% *} seconds" --rfc-2822`"; \ + echo; echo " -- $$author $$date"; echo; \ ) >$@ || (rm -f $@; false) .PHONY: $(word 1,$(CHANGELOGS)) # The first changelog entry must be recreated on each call @@ -72,7 +76,6 @@ clean:: mapsectorsh: mapsector lib/00_version.sh $(wildcard lib/[0-9][0-9]_*.sh) @echo "generating $@" @( \ - set -e; \ sed -n -e '1p' $<; \ echo "#"; \ echo "# $@ automatically generated from"; \