--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,7 @@
 	geany.pc.in \
 	geany.spec \
 	ChangeLog.pre-0-17 \
+	ChangeLog.pre-1-22 \
 	HACKING \
 	README.I18N \
 	README.Packagers \
@@ -85,6 +86,20 @@
 	done
 
 
+dist-hook:
+	@if test -d "$(top_srcdir)/.git"; then \
+		echo '  GEN    ChangeLog'; \
+		( cd "$(top_srcdir)" && \
+		  echo '# Generated by Makefile. Do not edit.' && echo && \
+		  git log --stat 0.21.0.. ) > ChangeLog.tmp \
+		&& mv -f ChangeLog.tmp "$(distdir)/ChangeLog" \
+		|| ( rm -f ChangeLog.tmp ; \
+		     echo 'Failed to generate ChangeLog' >&2 ); \
+	else \
+		echo 'A git clone is required to generate a ChangeLog' >&2; \
+	fi
+
+
 BZIP2_ENV =--best
 
 dist-bzip2: distdir