diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2015-01-06 09:36:00 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2015-01-06 09:37:28 +0200 |
commit | d2964dda42f601c514d3e822dc5efd75ef456a40 (patch) | |
tree | 5512e76e96b1b2e009f6beeefc2ba3a323a7e2d1 | |
parent | a42a0428deade09f9ac9755f9596ccf08f34dfc4 (diff) | |
download | ellinika-d2964dda42f601c514d3e822dc5efd75ef456a40.tar.gz ellinika-d2964dda42f601c514d3e822dc5efd75ef456a40.tar.bz2 |
Build ChangeLog.
* Makefile.am (ChangeLog): New goal.
* git2chg.awk: New file (from grecs).
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | git2chg.awk | 82 |
2 files changed, 91 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 2c075fc..2e4dd7e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ # This file is part of Ellinika project. -# Copyright (C) 2004, 2007, 2008, 2010 Sergey Poznyakoff +# Copyright (C) 2004, 2007, 2008, 2010, 2015 Sergey Poznyakoff # # Ellinika is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # @@ -45,6 +45,14 @@ install-html: fi; \ cd $$here; \ fi; \ done install-data-local: install-html + +.PHONY: ChangeLog +ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \ + awk -f $(top_srcdir)/git2chg.awk \ + -v append=$(top_srcdir)/ChangeLog.svn > ChangeLog; \ + fi diff --git a/git2chg.awk b/git2chg.awk new file mode 100644 index 0000000..76881b5 --- /dev/null +++ b/git2chg.awk @@ -0,0 +1,82 @@ +# This file is part of grecs +# Copyright (C) 2007, 2009-2015 Sergey Poznyakoff +# +# Grecs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# Grecs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Grecs. If not, see <http://www.gnu.org/licenses/>. + +BEGIN { + if (since) + split(since,since_a,"-") +} + +function timeok(t, a) { + if (!since) + return 1 + split(t,a,"-") + if (a[1] < since_a[1]) + return 0 + if (a[1] > since_a[1]) + return 1 + if (a[2] < since_a[2]) + return 0 + if (a[2] > since_a[2]) + return 1 + return a[3] > since_a[3] +} + +/^[0-9]+ .* +<[^>]+>/ { + s = strftime("%F", $1) + if (!timeok(s)) + exit + sub(/^[0-9]+ +/,"") + if (s == datestr && author == $0) + next + datestr = s + author = $0 + if (runlen) { runlen = 0; print "" } + printf("%s %s\n", datestr, author) + next +} +/^Signed-off-by:/ { next } +/^<unknown>$/ { next } +NF==0 { + runlen++ + next +} +{ if (runlen) { runlen = 0; print "" } + print "\t" $0 } + +END { + if (append) { + print "" + init = 1 + while ((getline < append) > 0) { + if (init) { + if (match($0, /^#/)) + continue; + else + init = 0 + } + if (match($0, /^Local *Variables:/)) + break + print + } + } + print "\f" + # Make sure Emacs won't recognize this line: + print "Local", "Variables:" + print "mode: change-log" + print "version-control: never" + print "buffer-read-only: t" + print "End:" +} |