File: mkchangelog

package info (click to toggle)
swi-prolog 5.10.1-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 76,436 kB
  • ctags: 45,143
  • sloc: ansic: 290,417; perl: 215,108; sh: 5,411; java: 5,136; makefile: 5,021; cpp: 2,168; yacc: 843; xml: 77; sed: 12
file content (74 lines) | stat: -rwxr-xr-x 1,228 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash

# Generate old-style ChangeLog files from the GIT log. Ultimately we may
# wish to insert this into ChangeLog

footer=false
printdate=true

done=false
while [ $done = false ]; do
    case "$1" in
	--footer)
		footer=true
		shift
		;;
	--nodate)
		printdate=false
		shift
		;;
	*)	done=true
		;;
    esac
done

since="$1"

if [ -z "$since" ]; then
   echo "Usage: `basename $0` [--footer] [--nodate] version [path ...]"
   exit 1
fi

shift;

# Ensure case-sensitive matching
LANG=C

case "$since" in
   [0-9].[0-9]*.[0-9]*)
	since=V${since}
	;;
esac

git log ${since}.. --pretty=format:"PATCH[%ad]%n%s%n%b" $* | awk '
BEGIN		{ doprint="false";
		  dateprinted="";
		}
/^PATCH[[]/	{ date="["  $2 " " $3 " " $5 "]";
		  doprint="false";
		  next;
	        }
/^[A-Z][A-Z]+:/	{ if ( dateprinted != date && "'$printdate'" == "true" )
		  { printf("%s\n\n", date);
		    dateprinted = date;
		  }
		  printf(" * %s\n", $0);
		  doprint="true";
		  next;
		}
/.*/ 		{ if ( doprint == "true" )
		  { if ( $0 != "<unknown>" )
		    { printf("   %s\n", $0);
		    } else
		    { printf("\n");
		    }
		  }
		  next;
		}
'

if [ "$footer" = true ]; then
   echo ==============
   echo VERSION $since
   echo ==============
fi