comparison lib-src/=rcs2log @ 16899:04ad9edd12b3

--help, --version: New options, for conformance to GNU coding standards. (Copyright, Help, Id): New variables, for above. (rlog): Use -q option with cvs log, to avoid useless chatter. Treat logs of "Initial revision" (RCS) or "file F was initially added on branch B." (CVS) as if they said "New file.", for consistency with change log entries.
author Paul Eggert <eggert@twinsun.com>
date Mon, 20 Jan 1997 09:03:05 +0000
parents 08855b88e955
children 9555c074333c
comparison
equal deleted inserted replaced
16898:6370d4132d69 16899:04ad9edd12b3
1 #! /bin/sh 1 #! /bin/sh
2 2
3 # RCS to ChangeLog generator 3 # RCS to ChangeLog generator
4 4
5 # Generate a change log prefix from RCS files and the ChangeLog (if any). 5 # Generate a change log prefix from RCS files (perhaps in the CVS repository)
6 # and the ChangeLog (if any).
6 # Output the new prefix to standard output. 7 # Output the new prefix to standard output.
7 # You can edit this prefix by hand, and then prepend it to ChangeLog. 8 # You can edit this prefix by hand, and then prepend it to ChangeLog.
8 9
9 # Ignore log entries that start with `#'. 10 # Ignore log entries that start with `#'.
10 # Clump together log entries that start with `{topic} ', 11 # Clump together log entries that start with `{topic} ',
11 # where `topic' contains neither white space nor `}'. 12 # where `topic' contains neither white space nor `}'.
12 13
13 # Author: Paul Eggert <eggert@twinsun.com> 14 Help='The default FILEs are the files registered under the working directory.
14 15 Options:
15 # $Id: rcs2log,v 1.34 1996/10/13 05:59:42 eggert Exp eggert $ 16
16 17 -c CHANGELOG Output a change log prefix to CHANGELOG (default ChangeLog).
17 # Copyright 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. 18 -h HOSTNAME Use HOSTNAME in change log entries (default current host).
19 -i INDENT Indent change log lines by INDENT spaces (default 8).
20 -l LENGTH Try to limit log lines to LENGTH characters (default 79).
21 -R If no FILEs are given and RCS is used, recurse through working directory.
22 -r OPTION Pass OPTION to subsidiary log command.
23 -t TABWIDTH Tab stops are every TABWIDTH characters (default 8).
24 -u "LOGIN<tab>FULLNAME<tab>MAILADDR" Assume LOGIN has FULLNAME and MAILADDR.
25 -v Append RCS revision to file names in log lines.
26 --help Output help.
27 --version Output version number.
28
29 Report bugs to <bug-gnu-emacs@prep.ai.mit.edu>.'
30
31 Id='$Id: rcs2log,v 1.35 1996/11/03 17:09:27 eggert Exp eggert $'
32
33 # Copyright 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
18 34
19 # This program is free software; you can redistribute it and/or modify 35 # This program is free software; you can redistribute it and/or modify
20 # it under the terms of the GNU General Public License as published by 36 # it under the terms of the GNU General Public License as published by
21 # the Free Software Foundation; either version 2, or (at your option) 37 # the Free Software Foundation; either version 2, or (at your option)
22 # any later version. 38 # any later version.
28 # 44 #
29 # You should have received a copy of the GNU General Public License 45 # You should have received a copy of the GNU General Public License
30 # along with this program; see the file COPYING. If not, write to the 46 # along with this program; see the file COPYING. If not, write to the
31 # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 47 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32 # Boston, MA 02111-1307, USA. 48 # Boston, MA 02111-1307, USA.
49
50 Copyright='Copyright 1997 Free Software Foundation, Inc.
51 This program comes with NO WARRANTY, to the extent permitted by law.
52 You may redistribute copies of this program
53 under the terms of the GNU General Public License.
54 For more information about these matters, see the files named COPYING.
55 Author: Paul Eggert <eggert@twinsun.com>'
33 56
34 tab=' ' 57 tab=' '
35 nl=' 58 nl='
36 ' 59 '
37 60
97 ;; 120 ;;
98 -r) rlog_options=$rlog_options$nl${2?}; shift;; 121 -r) rlog_options=$rlog_options$nl${2?}; shift;;
99 -R) recursive=t;; 122 -R) recursive=t;;
100 -t) tabwidth=${2?}; shift;; 123 -t) tabwidth=${2?}; shift;;
101 -v) revision=t;; 124 -v) revision=t;;
102 -*) echo >&2 "$0: usage: $0 [options] [file ...] 125 --version)
103 Options: 126 set $Id
104 [-c changelog] [-h hostname] [-i indent] [-l length] [-R] 127 rcs2logVersion=$3
105 [-r rlog_option] [-t tabwidth] [-v] 128 echo >&2 "rcs2log (GNU Emacs) $rcs2logVersion$nl$Copyright"
106 [-u 'login<TAB>fullname<TAB>mailaddr']..." 129 exit 0;;
107 exit 1;; 130 -*) echo >&2 "Usage: $0 [OPTION]... [FILE ...]$nl$Help"
131 case $1 in
132 --help) exit 0;;
133 *) exit 1
134 esac;;
108 *) break 135 *) break
109 esac 136 esac
110 shift 137 shift
111 done 138 done
112 139
172 if test ! -f CVS/Repository 199 if test ! -f CVS/Repository
173 then 200 then
174 rlog=rlog 201 rlog=rlog
175 repository= 202 repository=
176 else 203 else
177 rlog='cvs log' 204 rlog='cvs -q log'
178 repository=`sed 1q <CVS/Repository` || exit 205 repository=`sed 1q <CVS/Repository` || exit
179 test ! -f CVS/Root || CVSROOT=`cat <CVS/Root` || exit 206 test ! -f CVS/Root || CVSROOT=`cat <CVS/Root` || exit
180 case $CVSROOT in 207 case $CVSROOT in
181 *:/*) 208 *:/*)
182 # remote repository 209 # remote repository
486 rev = "?" 513 rev = "?"
487 next 514 next
488 } 515 }
489 if ($0 ~ /^branches: /) { next } 516 if ($0 ~ /^branches: /) { next }
490 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next } 517 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next }
518 if ($0 == "Initial revision" || $0 ~ /^file .+ was initially added on branch .+\.$/) {
519 $0 = "New file."
520 }
491 printf "%s%c", $0, 13 521 printf "%s%c", $0, 13
492 } 522 }
493 ' | 523 ' |
494 524
495 # Now each line is of the form 525 # Now each line is of the form