[projects/rc-scripts] new script to generate ChangeLog from git repository

draenog draenog at pld-linux.org
Sat Nov 2 22:49:47 CET 2013


commit 78fe1608f407cdff06b1c17d2c9b5230269da1ef
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Sat Nov 2 22:23:13 2013 +0100

    new script to generate ChangeLog from git repository

 changelog.sh | 41 ++---------------------------------------
 1 file changed, 2 insertions(+), 39 deletions(-)
---
diff --git a/changelog.sh b/changelog.sh
index 2d19930..54baf7d 100755
--- a/changelog.sh
+++ b/changelog.sh
@@ -1,45 +1,8 @@
 #!/bin/sh
-# $Id$
 # Run this to generate ChangeLog.
 
-if [ ! -x /usr/bin/svn2log ]; then
-	echo >&2 'Need svn2log program!'
-	exit 1
-fi
-
-# make sure '.' entry is up to date, or the log will be outdated too
-svn up . >/dev/null
-
-# create users for svn2log format
-tmp=$(mktemp -q svn2logXXXXXX 2>/dev/null || echo ${TMPDIR:-/tmp}/svn2log.tmp)
-> $tmp
-
-[ -z "$users" -a -f ../CVSROOT/users ] && users=../CVSROOT/users
-[ -z "$users" -a -f ~/.CVS-PLD/CVSROOT/users ] && users=~/.CVS-PLD/CVSROOT/users
-if [ -z "$users" ]; then
-	echo >&2 "Can't find users file!"
-	echo >&2 'Run in parent dir to fetch one:'
-	echo >&2 '$ cvs -d :pserver:cvs at cvs.pld-linux.org:/cvsroot co CVSROOT/users'
-	exit 1
-fi
-
-# be sure users file is up to date
-(
-	cd $(dirname "$users")
-	cvs up users
-)
-
-awk -F":" ' { login=$1; if ($3 != "") { name=$3 } else { name=$1 }; email=$2; printf "%s\t%s <%s at pld-linux.org>\n", login, name, login } ' $users > $tmp
-
-branch=$(svn info | awk '/URL:/{print $NF}' | sed -e 's,^.*svn.pld-linux.org/svn,,')
-
-if grep -q vim:encoding=utf-8 $users; then
-	charset=UTF-8
-else
-	charset=ISO8859-2
-fi
-LC_ALL=C svn log -v --xml | LC_ALL=C svn2log --users-charset=$charset --domain "pld-linux.org" -p $branch -u $tmp --exclude ChangeLog -o ChangeLog
-rm -f $tmp
+[ -e .git/shallow ] && git fetch --unshallow
+git log --format='%+ai [%h] %aN <%ae>%n%n%x09* %s' --stat | sed '1d' > ChangeLog
 
 # obfuscate emails <user at domain> and (user at domain)
 sed -i -e 's,\([<(].*\)@\(.*[)>]\),\1/at/\2,g' ChangeLog
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/251457114d29f2476ae28d8f9612e328e2eaae5f



More information about the pld-cvs-commit mailing list