From: Graham Knop Date: Wed, 2 Sep 2015 10:53:13 +0000 (-0400) Subject: include full release changelog in nextrelease X-Git-Tag: v0.003000~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c1a1a773975ea33d70b59f5a7b9cd03988d500e4;p=p5sagit%2FDistar.git include full release changelog in nextrelease --- diff --git a/helpers/changelog-context b/helpers/changelog-context new file mode 100755 index 0000000..5ab2115 --- /dev/null +++ b/helpers/changelog-context @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +use strict; +use warnings FATAL => 'all'; + +my $version = shift or die "no version specified!"; +my $changelog = shift or die "no changelog file specified!"; + +open my $fh, '<', $changelog + or die "can't open $changelog: $!"; +my $context; +my $found_version; +while (my $line = <$fh>) { + if ($found_version) { + last + if $line =~ /^\S/; + $context++; + } + elsif ($line =~ /^v?\Q$version\E/) { + $found_version = 1; + } +} +close $fh; +die "couldn't find heading for $version!" + unless $found_version; + +print "$context\n"; diff --git a/lib/Distar.pm b/lib/Distar.pm index 510e3e7..ab7838f 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -127,7 +127,7 @@ distmanicheck: create_distdir cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck" nextrelease: $(ABSPERLRUN) Distar/helpers/add-changelog-heading $(VERSION) Changes - git add -p Changes + GIT_DIFF_OPTS=-u`$(ABSPERLRUN) Distar/helpers/changelog-context $(VERSION) Changes` git add -p Changes refresh: cd Distar && git pull rm Makefile