head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RELEASE:1.1.1.1
	netbsd-11-0-RC7:1.1.1.1
	netbsd-11-0-RC6:1.1.1.1
	netbsd-11-0-RC5:1.1.1.1
	netbsd-11-0-RC4:1.1.1.1
	netbsd-11-0-RC3:1.1.1.1
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	perseant-exfatfs-base-20250801:1.1.1.1
	netbsd-11:1.1.1.1.0.78
	netbsd-11-base:1.1.1.1
	netbsd-10-1-RELEASE:1.1.1.1
	perseant-exfatfs-base-20240630:1.1.1.1
	perseant-exfatfs:1.1.1.1.0.76
	perseant-exfatfs-base:1.1.1.1
	netbsd-8-3-RELEASE:1.1.1.1
	netbsd-9-4-RELEASE:1.1.1.1
	netbsd-10-0-RELEASE:1.1.1.1
	netbsd-10-0-RC6:1.1.1.1
	netbsd-10-0-RC5:1.1.1.1
	netbsd-10-0-RC4:1.1.1.1
	netbsd-10-0-RC3:1.1.1.1
	netbsd-10-0-RC2:1.1.1.1
	netbsd-10-0-RC1:1.1.1.1
	netbsd-10:1.1.1.1.0.74
	netbsd-10-base:1.1.1.1
	netbsd-9-3-RELEASE:1.1.1.1
	cjep_sun2x-base1:1.1.1.1
	cjep_sun2x:1.1.1.1.0.72
	cjep_sun2x-base:1.1.1.1
	cjep_staticlib_x-base1:1.1.1.1
	netbsd-9-2-RELEASE:1.1.1.1
	cjep_staticlib_x:1.1.1.1.0.70
	cjep_staticlib_x-base:1.1.1.1
	netbsd-9-1-RELEASE:1.1.1.1
	phil-wifi-20200421:1.1.1.1
	phil-wifi-20200411:1.1.1.1
	is-mlppp:1.1.1.1.0.68
	is-mlppp-base:1.1.1.1
	phil-wifi-20200406:1.1.1.1
	netbsd-8-2-RELEASE:1.1.1.1
	netbsd-9-0-RELEASE:1.1.1.1
	netbsd-9-0-RC2:1.1.1.1
	netbsd-9-0-RC1:1.1.1.1
	phil-wifi-20191119:1.1.1.1
	netbsd-9:1.1.1.1.0.66
	netbsd-9-base:1.1.1.1
	phil-wifi-20190609:1.1.1.1
	netbsd-8-1-RELEASE:1.1.1.1
	netbsd-8-1-RC1:1.1.1.1
	pgoyette-compat-merge-20190127:1.1.1.1
	pgoyette-compat-20190127:1.1.1.1
	pgoyette-compat-20190118:1.1.1.1
	pgoyette-compat-1226:1.1.1.1
	pgoyette-compat-1126:1.1.1.1
	pgoyette-compat-1020:1.1.1.1
	pgoyette-compat-0930:1.1.1.1
	pgoyette-compat-0906:1.1.1.1
	netbsd-7-2-RELEASE:1.1.1.1
	pgoyette-compat-0728:1.1.1.1
	netbsd-8-0-RELEASE:1.1.1.1
	phil-wifi:1.1.1.1.0.64
	phil-wifi-base:1.1.1.1
	pgoyette-compat-0625:1.1.1.1
	netbsd-8-0-RC2:1.1.1.1
	pgoyette-compat-0521:1.1.1.1
	pgoyette-compat-0502:1.1.1.1
	pgoyette-compat-0422:1.1.1.1
	netbsd-8-0-RC1:1.1.1.1
	pgoyette-compat-0415:1.1.1.1
	pgoyette-compat-0407:1.1.1.1
	pgoyette-compat-0330:1.1.1.1
	pgoyette-compat-0322:1.1.1.1
	pgoyette-compat-0315:1.1.1.1
	netbsd-7-1-2-RELEASE:1.1.1.1
	pgoyette-compat:1.1.1.1.0.62
	pgoyette-compat-base:1.1.1.1
	netbsd-7-1-1-RELEASE:1.1.1.1
	matt-nb8-mediatek:1.1.1.1.0.60
	matt-nb8-mediatek-base:1.1.1.1
	perseant-stdc-iso10646:1.1.1.1.0.58
	perseant-stdc-iso10646-base:1.1.1.1
	netbsd-8:1.1.1.1.0.56
	netbsd-8-base:1.1.1.1
	prg-localcount2-base3:1.1.1.1
	prg-localcount2-base2:1.1.1.1
	prg-localcount2-base1:1.1.1.1
	prg-localcount2:1.1.1.1.0.54
	prg-localcount2-base:1.1.1.1
	pgoyette-localcount-20170426:1.1.1.1
	bouyer-socketcan-base1:1.1.1.1
	pgoyette-localcount-20170320:1.1.1.1
	netbsd-7-1:1.1.1.1.0.52
	netbsd-7-1-RELEASE:1.1.1.1
	netbsd-7-1-RC2:1.1.1.1
	netbsd-7-nhusb-base-20170116:1.1.1.1
	bouyer-socketcan:1.1.1.1.0.50
	bouyer-socketcan-base:1.1.1.1
	pgoyette-localcount-20170107:1.1.1.1
	netbsd-7-1-RC1:1.1.1.1
	pgoyette-localcount-20161104:1.1.1.1
	netbsd-7-0-2-RELEASE:1.1.1.1
	localcount-20160914:1.1.1.1
	netbsd-7-nhusb:1.1.1.1.0.48
	netbsd-7-nhusb-base:1.1.1.1
	pgoyette-localcount-20160806:1.1.1.1
	pgoyette-localcount-20160726:1.1.1.1
	pgoyette-localcount:1.1.1.1.0.46
	pgoyette-localcount-base:1.1.1.1
	netbsd-7-0-1-RELEASE:1.1.1.1
	netbsd-7-0:1.1.1.1.0.44
	netbsd-7-0-RELEASE:1.1.1.1
	netbsd-7-0-RC3:1.1.1.1
	netbsd-7-0-RC2:1.1.1.1
	netbsd-7-0-RC1:1.1.1.1
	am-utils-6-2-20140117:1.1.1.1
	netbsd-5-2-3-RELEASE:1.1.1.1
	netbsd-5-1-5-RELEASE:1.1.1.1
	netbsd-6-0-6-RELEASE:1.1.1.1
	netbsd-6-1-5-RELEASE:1.1.1.1
	netbsd-7:1.1.1.1.0.42
	netbsd-7-base:1.1.1.1
	yamt-pagecache-base9:1.1.1.1
	yamt-pagecache-tag8:1.1.1.1
	netbsd-6-1-4-RELEASE:1.1.1.1
	netbsd-6-0-5-RELEASE:1.1.1.1
	tls-earlyentropy:1.1.1.1.0.40
	tls-earlyentropy-base:1.1.1.1
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.1
	riastradh-drm2-base3:1.1.1.1
	netbsd-6-1-3-RELEASE:1.1.1.1
	netbsd-6-0-4-RELEASE:1.1.1.1
	netbsd-5-2-2-RELEASE:1.1.1.1
	netbsd-5-1-4-RELEASE:1.1.1.1
	netbsd-6-1-2-RELEASE:1.1.1.1
	netbsd-6-0-3-RELEASE:1.1.1.1
	netbsd-5-2-1-RELEASE:1.1.1.1
	netbsd-5-1-3-RELEASE:1.1.1.1
	netbsd-6-1-1-RELEASE:1.1.1.1
	riastradh-drm2-base2:1.1.1.1
	riastradh-drm2-base1:1.1.1.1
	riastradh-drm2:1.1.1.1.0.32
	riastradh-drm2-base:1.1.1.1
	netbsd-6-1:1.1.1.1.0.38
	netbsd-6-0-2-RELEASE:1.1.1.1
	netbsd-6-1-RELEASE:1.1.1.1
	khorben-n900:1.1.1.1.0.36
	netbsd-6-1-RC4:1.1.1.1
	netbsd-6-1-RC3:1.1.1.1
	agc-symver:1.1.1.1.0.34
	agc-symver-base:1.1.1.1
	netbsd-6-1-RC2:1.1.1.1
	netbsd-6-1-RC1:1.1.1.1
	yamt-pagecache-base8:1.1.1.1
	netbsd-5-2:1.1.1.1.0.30
	netbsd-6-0-1-RELEASE:1.1.1.1
	yamt-pagecache-base7:1.1.1.1
	netbsd-5-2-RELEASE:1.1.1.1
	netbsd-5-2-RC1:1.1.1.1
	matt-nb6-plus-nbase:1.1.1.1
	yamt-pagecache-base6:1.1.1.1
	netbsd-6-0:1.1.1.1.0.28
	netbsd-6-0-RELEASE:1.1.1.1
	netbsd-6-0-RC2:1.1.1.1
	tls-maxphys:1.1.1.1.0.26
	tls-maxphys-base:1.1.1.1
	matt-nb6-plus:1.1.1.1.0.24
	matt-nb6-plus-base:1.1.1.1
	netbsd-6-0-RC1:1.1.1.1
	yamt-pagecache-base5:1.1.1.1
	yamt-pagecache-base4:1.1.1.1
	netbsd-6:1.1.1.1.0.22
	netbsd-6-base:1.1.1.1
	netbsd-5-1-2-RELEASE:1.1.1.1
	netbsd-5-1-1-RELEASE:1.1.1.1
	yamt-pagecache-base3:1.1.1.1
	yamt-pagecache-base2:1.1.1.1
	yamt-pagecache:1.1.1.1.0.2
	yamt-pagecache-base:1.1.1.1
	cherry-xenmp:1.1.1.1.0.20
	cherry-xenmp-base:1.1.1.1
	bouyer-quota2-nbase:1.1.1.1
	bouyer-quota2:1.1.1.1.0.18
	bouyer-quota2-base:1.1.1.1
	matt-mips64-premerge-20101231:1.1.1.1
	matt-nb5-mips64-premerge-20101231:1.1.1.1
	matt-nb5-pq3:1.1.1.1.0.16
	matt-nb5-pq3-base:1.1.1.1
	netbsd-5-1:1.1.1.1.0.14
	netbsd-5-1-RELEASE:1.1.1.1
	netbsd-5-1-RC4:1.1.1.1
	matt-nb5-mips64-k15:1.1.1.1
	netbsd-5-1-RC3:1.1.1.1
	netbsd-5-1-RC2:1.1.1.1
	netbsd-5-1-RC1:1.1.1.1
	netbsd-5-0-2-RELEASE:1.1.1.1
	matt-nb5-mips64-premerge-20091211:1.1.1.1
	matt-premerge-20091211:1.1.1.1
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.1.1.1
	matt-nb4-mips64-k7-u2a-k9b:1.1.1.1
	matt-nb5-mips64-u1-k1-k5:1.1.1.1
	matt-nb5-mips64:1.1.1.1.0.12
	netbsd-5-0-1-RELEASE:1.1.1.1
	jym-xensuspend-nbase:1.1.1.1
	netbsd-5-0:1.1.1.1.0.10
	netbsd-5-0-RELEASE:1.1.1.1
	netbsd-5-0-RC4:1.1.1.1
	am-utils-6-2a3-20090320:1.1.1.1
	netbsd-5-0-RC3:1.1.1.1
	netbsd-5-0-RC2:1.1.1.1
	jym-xensuspend:1.1.1.1.0.8
	jym-xensuspend-base:1.1.1.1
	netbsd-5-0-RC1:1.1.1.1
	haad-dm-base:1.1.1.1
	haad-dm-base2:1.1.1.1
	haad-nbase2:1.1.1.1
	netbsd-5:1.1.1.1.0.6
	netbsd-5-base:1.1.1.1
	matt-mips64-base2:1.1.1.1
	haad-dm:1.1.1.1.0.4
	haad-dm-base1:1.1.1.1
	am-utils-6-2a3-20080919:1.1.1.1
	ezk:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2008.09.19.20.07.14;	author christos;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2008.09.19.20.07.14;	author christos;	state Exp;
branches
	1.1.1.1.4.1;
next	;

1.1.1.1.4.1
date	2008.09.19.20.07.14;	author haad;	state dead;
branches;
next	1.1.1.1.4.2;

1.1.1.1.4.2
date	2008.10.19.22.39.29;	author haad;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#! /bin/sh

# commit version 0.9.2

# Copyright (C) 1999, Free Software Foundation

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# Originally by Gary V. Vaughan <gvaughan@@oranda.demon.co.uk>
# Heavily modified by Alexandre Oliva <oliva@@dcc.unicamp.br>

# This scripts eases checking in changes to CVS-maintained projects
# with ChangeLog files.  It will check that there have been no
# conflicting commits in the CVS repository and print which files it
# is going to commit to stderr.  A list of files to compare and to
# check in can be given in the command line.  If it is not given, all
# files in the current directory (and below, unless `-l' is given) are
# considered for check in.

# The commit message will be extracted from the differences between
# the local ChangeLog and the one in the repository (unless a message
# was specified with `-m' or `-F').  An empty message is not accepted
# (but a blank line is).  If the message is acceptable, it will be
# presented for verification (and possible edition) using the $PAGER
# environment variable (or `more', if it is not set, or `cat', if the
# `-f' switch is given).  If $PAGER exits successfully, the modified
# files (at that moment) are checked in, unless `-n' was specified, in
# which case nothing is checked in.

# usage: commit [-v] [-h] [-f] [-l] [-n] [-q] [-z N]
#               [-m msg|-F msg_file] [--] [file|dir ...]

# -f      --fast        don't check (unless *followed* by -n), and just
#         --force       display commit message instead of running $PAGER
# -l      --local       don't descend into subdirectories
# -m msg  --message=msg set commit message
#         --msg=msg     same as -m
# -F file --file=file   read commit message from file
# -n      --dry-run     don't commit anything
# -q      --quiet       run cvs in quiet mode
# -zN     --compress=N  set compression level (0-9, 0=none, 9=max)
# -v      --version     print version information
# -h,-?   --help        print short or long help message

name=commit
cvsopt=
updateopt=
commitopt=
dry_run=false
commit=:
update=:
log_file="${TMPDIR-/tmp}/commitlog.$$"

rm -f "$log_file"
trap 'rm -f "$log_file"; exit 1' 1 2 15

# this just eases exit handling
main_repeat=":"
while $main_repeat; do

repeat="test $# -gt 0"
while $repeat; do
    case "$1" in
    -f|--force|--fast)
	update=false
	PAGER=cat
	shift
	;;
    -l|--local)
	updateopt="$updateopt -l"
	commitopt="$commitopt -l"
	shift
	;;
    -m|--message|--msg)
	if test $# = 1; then
	    echo "$name: missing argument for $1" >&2
	    break
	fi
	if test -f "$log_file"; then
	    echo "$name: you can have at most one of -m and -F" >&2
	    break
	fi
	shift
	echo "$1" > "$log_file"
	shift
	;;
    -F|--file)
	if test -f "$log_file"; then
	    echo "$name: you can have at most one of -m and -F" >&2
	    break
	fi
	if test $# = 1; then
	    echo "$name: missing argument for $1" >&2
	    break
	fi
	shift
	if cat < "$1" > "$log_file"; then :; else
	    break
	fi
	shift
	;;
    -n|--dry-run)
	commit=false
	update=true
	shift
	;;
    -q|--quiet)
	cvsopt="$cvsopt -q"
	shift
	;;
    -z|--compress)
	if test $# = 1; then
	    echo "$name: missing argument for $1" >&2
	    break
	fi
	case "$2" in
	[0-9]) :;;
	*)  echo "$name: invalid argument for $1" >&2
	    break
	    ;;
	esac
	cvsopt="$cvsopt -z$2"
	shift
	shift
	;;

    -m*|-F*|-z*)
	opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
	arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
	shift
	set -- "$opt" "$arg" ${1+"$@@"}
	;;
    --message=*|--msg=*|--file=*|--compress=*)
	opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
    	arg=`echo "$1" | sed '1s/^--[^=]*=//'`
	shift
	set -- "$opt" "$arg" ${1+"$@@"}
	;;

    -v|--version)
	sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
	exit 0
	;;
    -\?|-h)
	sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
	echo
	echo "run \`$name --help | more' for full usage"
	exit 0
	;;
    --help)
	sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
	exit 0
	;;
    --)
	shift
	repeat=false
	;;
    -*)
	echo "$name: invalid flag $1" >&2
	break
	;;
    *)
	repeat=false
	;;
    esac
done
# might have used break 2 within the previous loop, but so what
$repeat && break

$update && \
if echo "$name: checking for conflicts..." >&2
   (cvs $cvsopt -q -n update $updateopt ${1+"$@@"} 2>/dev/null \
    | while read line; do
	echo "$line"
	echo "$line" >&3
      done | grep '^C') 3>&1 >/dev/null; then
  echo "$name: some conflicts were found, aborting..." >&2
  break
fi

if test ! -f "$log_file"; then
  echo "$name: checking commit message..." >&2
  cvs $cvsopt diff -u ChangeLog \
  | while read line; do
      case "$line" in
      "--- ChangeLog"*) :;;
      "-"*)
	echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
	echo "$line" | sed 's/^.//' >&2;;
      "+ "*)
	echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
	echo "$line" | sed 's/^.//' >&2;;
      "+") echo;;
      "+	"*) echo "$line";;
      esac
    done \
  | sed -e 's,\+	,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
  || break
# The sed script above removes "+TAB" from the beginning of a line, then
# deletes the first and/or the last line, when they happen to be empty
fi

if grep '[^ 	]' < "$log_file" > /dev/null; then :; else
  echo "$name: empty commit message, aborting" >&2
  break
fi

if grep '^$' < "$log_file" > /dev/null; then
  echo "$name: *** Warning: blank lines should not appear within a commit messages." >&2
  echo "$name: *** They should be used to separate distinct commits." >&2
fi

${PAGER-more} "$log_file" || break

sleep 1 # give the user some time for a ^C

# Do not check for empty $log_file again, even though the user might have
# zeroed it out.  If s/he did, it was probably intentional.

if $commit; then
  cvs $cvsopt commit $commitopt -F $log_file ${1+"$@@"} || break
fi

main_repeat=false
done

rm -f "$log_file"

# if main_repeat was not set to `false', we failed
$main_repeat && exit 1
exit 0
@


1.1.1.1
log
@import current am-utils.
@
text
@@


1.1.1.1.4.1
log
@file commit was added on branch haad-dm on 2008-10-19 22:39:29 +0000
@
text
@d1 233
@


1.1.1.1.4.2
log
@Sync with HEAD.
@
text
@a0 233
#! /bin/sh

# commit version 0.9.2

# Copyright (C) 1999, Free Software Foundation

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# Originally by Gary V. Vaughan <gvaughan@@oranda.demon.co.uk>
# Heavily modified by Alexandre Oliva <oliva@@dcc.unicamp.br>

# This scripts eases checking in changes to CVS-maintained projects
# with ChangeLog files.  It will check that there have been no
# conflicting commits in the CVS repository and print which files it
# is going to commit to stderr.  A list of files to compare and to
# check in can be given in the command line.  If it is not given, all
# files in the current directory (and below, unless `-l' is given) are
# considered for check in.

# The commit message will be extracted from the differences between
# the local ChangeLog and the one in the repository (unless a message
# was specified with `-m' or `-F').  An empty message is not accepted
# (but a blank line is).  If the message is acceptable, it will be
# presented for verification (and possible edition) using the $PAGER
# environment variable (or `more', if it is not set, or `cat', if the
# `-f' switch is given).  If $PAGER exits successfully, the modified
# files (at that moment) are checked in, unless `-n' was specified, in
# which case nothing is checked in.

# usage: commit [-v] [-h] [-f] [-l] [-n] [-q] [-z N]
#               [-m msg|-F msg_file] [--] [file|dir ...]

# -f      --fast        don't check (unless *followed* by -n), and just
#         --force       display commit message instead of running $PAGER
# -l      --local       don't descend into subdirectories
# -m msg  --message=msg set commit message
#         --msg=msg     same as -m
# -F file --file=file   read commit message from file
# -n      --dry-run     don't commit anything
# -q      --quiet       run cvs in quiet mode
# -zN     --compress=N  set compression level (0-9, 0=none, 9=max)
# -v      --version     print version information
# -h,-?   --help        print short or long help message

name=commit
cvsopt=
updateopt=
commitopt=
dry_run=false
commit=:
update=:
log_file="${TMPDIR-/tmp}/commitlog.$$"

rm -f "$log_file"
trap 'rm -f "$log_file"; exit 1' 1 2 15

# this just eases exit handling
main_repeat=":"
while $main_repeat; do

repeat="test $# -gt 0"
while $repeat; do
    case "$1" in
    -f|--force|--fast)
	update=false
	PAGER=cat
	shift
	;;
    -l|--local)
	updateopt="$updateopt -l"
	commitopt="$commitopt -l"
	shift
	;;
    -m|--message|--msg)
	if test $# = 1; then
	    echo "$name: missing argument for $1" >&2
	    break
	fi
	if test -f "$log_file"; then
	    echo "$name: you can have at most one of -m and -F" >&2
	    break
	fi
	shift
	echo "$1" > "$log_file"
	shift
	;;
    -F|--file)
	if test -f "$log_file"; then
	    echo "$name: you can have at most one of -m and -F" >&2
	    break
	fi
	if test $# = 1; then
	    echo "$name: missing argument for $1" >&2
	    break
	fi
	shift
	if cat < "$1" > "$log_file"; then :; else
	    break
	fi
	shift
	;;
    -n|--dry-run)
	commit=false
	update=true
	shift
	;;
    -q|--quiet)
	cvsopt="$cvsopt -q"
	shift
	;;
    -z|--compress)
	if test $# = 1; then
	    echo "$name: missing argument for $1" >&2
	    break
	fi
	case "$2" in
	[0-9]) :;;
	*)  echo "$name: invalid argument for $1" >&2
	    break
	    ;;
	esac
	cvsopt="$cvsopt -z$2"
	shift
	shift
	;;

    -m*|-F*|-z*)
	opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
	arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
	shift
	set -- "$opt" "$arg" ${1+"$@@"}
	;;
    --message=*|--msg=*|--file=*|--compress=*)
	opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
    	arg=`echo "$1" | sed '1s/^--[^=]*=//'`
	shift
	set -- "$opt" "$arg" ${1+"$@@"}
	;;

    -v|--version)
	sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
	exit 0
	;;
    -\?|-h)
	sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
	echo
	echo "run \`$name --help | more' for full usage"
	exit 0
	;;
    --help)
	sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
	exit 0
	;;
    --)
	shift
	repeat=false
	;;
    -*)
	echo "$name: invalid flag $1" >&2
	break
	;;
    *)
	repeat=false
	;;
    esac
done
# might have used break 2 within the previous loop, but so what
$repeat && break

$update && \
if echo "$name: checking for conflicts..." >&2
   (cvs $cvsopt -q -n update $updateopt ${1+"$@@"} 2>/dev/null \
    | while read line; do
	echo "$line"
	echo "$line" >&3
      done | grep '^C') 3>&1 >/dev/null; then
  echo "$name: some conflicts were found, aborting..." >&2
  break
fi

if test ! -f "$log_file"; then
  echo "$name: checking commit message..." >&2
  cvs $cvsopt diff -u ChangeLog \
  | while read line; do
      case "$line" in
      "--- ChangeLog"*) :;;
      "-"*)
	echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
	echo "$line" | sed 's/^.//' >&2;;
      "+ "*)
	echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
	echo "$line" | sed 's/^.//' >&2;;
      "+") echo;;
      "+	"*) echo "$line";;
      esac
    done \
  | sed -e 's,\+	,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
  || break
# The sed script above removes "+TAB" from the beginning of a line, then
# deletes the first and/or the last line, when they happen to be empty
fi

if grep '[^ 	]' < "$log_file" > /dev/null; then :; else
  echo "$name: empty commit message, aborting" >&2
  break
fi

if grep '^$' < "$log_file" > /dev/null; then
  echo "$name: *** Warning: blank lines should not appear within a commit messages." >&2
  echo "$name: *** They should be used to separate distinct commits." >&2
fi

${PAGER-more} "$log_file" || break

sleep 1 # give the user some time for a ^C

# Do not check for empty $log_file again, even though the user might have
# zeroed it out.  If s/he did, it was probably intentional.

if $commit; then
  cvs $cvsopt commit $commitopt -F $log_file ${1+"$@@"} || break
fi

main_repeat=false
done

rm -f "$log_file"

# if main_repeat was not set to `false', we failed
$main_repeat && exit 1
exit 0
@
