5 # This utility is used to generate a compact list of changes
6 # for each release, bjm 2000-02-22
8 # Usage: pgcvslog [-d] [-h]
9 # -d delete commits that include back branches
11 # "-d" is useful for generating release notes for major releases
13 # This program basically takes a cvs log, groups it by commit timestamp
14 # and line number, then compares adjacent messages. If they have the same
15 # commit message, they are assumed to be part of the same commit and
16 # appear as one commit message with multiple file names
19 # cvs log -d'>1999-06-14 00:00:00 GMT' . > log
22 # cvs log -d'>2000-05-29 00:00:00 GMT' -b .
25 # cvs log -d'>2000-05-29 00:00:00 GMT' -rREL8_0_STABLE .
28 # cvs log -d'2005-05-08<2005-05-29' -rREL8_0_STABLE .
30 # To find branch time, look for "branches:" tag in CVS commit logs
31 # e.g. "branches: 1.398.4;" matches "REL8_0_STABLE: 1.398.0.4".
33 # Remove these from the log file before processing to reduce the number
34 # of unneeded log entries:
36 # /cvsroot/pgsql/doc/TODO
37 # /cvsroot/pgsql/doc/FAQ
38 # /cvsroot/pgsql/doc/src/FAQ/TODO.html
39 # /cvsroot/pgsql/doc/src/FAQ/FAQ.html
59 if [ "$HTML" = "Y" -a "$DEL" = "Y" ]
60 then echo "Cannot use -d and -h together" 1>&2
66 # protect HTML input if in HTML mode
68 then sed -e 's/\&/\&/g' \
75 # mark each line with a datetime and line number, for sorting and merging
76 # we are just pre-processing the file at this point
77 # We don't print anything from the -- or == line and the date:
79 awk ' BEGIN {html="'"$HTML"'"; lineno = 0;}
80 # store working directory
81 $0 ~ /^Working file:/ {workingfile = "/" $3}
83 # no need to show TODO or FAQ changes in the output
85 (workingfile == "/doc/TODO" || workingfile == "/doc/src/FAQ/TODO.html" ||
86 workingfile == "/doc/FAQ" || workingfile == "/doc/src/FAQ/FAQ.html") \
89 ($0 ~ /^====*$/ || $0 ~ /^----*$/) \
91 # print blank line to separate entries
95 printf ("%s| %10d|%s\n", datetime, lineno++, "");
96 printf ("%s| %10d|", datetime, lineno++);
98 printf ("%s\n", "---");
99 else printf ("<HR>\n");
104 # if we have a saved datetime, print filename, date line, and committer
105 datetime != "" && $1 != "branches:" {printf ("%s| %10d| %s\n", datetime, lineno++, $0);}
111 if (workingfile != "")
113 printf ("%s| %10d|", datetime, lineno++);
115 printf ("%s%s\n", workingfile, back_branch);
116 else printf ("<SMALL><FONT COLOR=\"red\">%s%s</FONT></SMALL>\n", workingfile, back_branch);
118 # output name of committer
119 # remove semicolon from committers name
123 printf ("%s| %10d|", datetime, lineno++);
125 printf ("%78s\n", $5);
126 else printf ("<DIV ALIGN=\"right\"><SMALL><FONT COLOR=\"teal\">%s</FONT> <FONT COLOR=\"green\">%s</FONT></SMALL></DIV>\n", $5, $2);
133 # back branches have +2 periods in revision number
135 back_branch=" <branch>"
136 else back_branch = ""
139 /* clear working file */
140 $0 ~ /^====*$/ {workingfile=""}' |
142 sort | cut
-d'|' -f3 |
144 # collect duplicate narratives
145 # print file names as we get them, then print narrative when a new
147 # have to save two narratives to compare them
149 awk ' BEGIN { narr_slot = 0; oldnarr_slot=0; save_working = "";
152 # We have a filename, so we look at the previous
153 # narrative to see if it is new narrative text.
156 # If there are a different number of narrative
157 # lines, they cannot possibly be the same.
158 if (narr_slot != oldnarr_slot)
163 for (i=1; i <= narr_slot; i++)
165 if (oldnarr[i] != narr[i])
173 # dump out the old narrative if it is new
177 for (i=1; i <= oldnarr_slot; i++)
181 oldnarr[i] != "<HR>" &&
182 oldnarr[i] !~ "^<DIV ")
186 # save the current narrative
187 for (i=1; i <= narr_slot; i++)
188 oldnarr[i] = narr[i];
189 oldnarr_slot = narr_slot;
193 # dump out the previous filename
199 # store the current filename for later printing
203 # we have a narrative line
205 # accumulate narrative
206 narr[++narr_slot] = $0;
211 # If there are a different number of narrative
212 # lines, they can not possibly be the same.
213 if (narr_slot != oldnarr_slot)
218 for (i=1; i <= narr_slot; i++)
220 if (oldnarr[i] != narr[i])
228 # dump out the old narrative if it is new
232 for (i=1; i <= oldnarr_slot; i++)
236 oldnarr[i] != "<HR>" &&
237 oldnarr[i] !~ "^<DIV ")
242 # dump out the last filename
248 # dump out the last narrative
249 for (i=1; i <= narr_slot; i++)
263 echo "<TITLE>CVS</TITLE>"
272 # if requested, remove any commit that has the "<branch>" text
284 for (i=1; i <= slot; i++)
285 if (commit[i] ~ "<branch>")
288 for (i=1; i <= slot; i++)
300 for (i=1; i <= slot; i++)
301 if (commit[i] ~ "<branch>")
304 for (i=1; i <= slot; i++)