Remove clcommit.m4sh.

* clcommit.m4sh: Removed. This script was written to help keep
ChangeLog and commit messages in sync when committing to CVS,
and is an anachronism now that Libtool uses git.
* Makefile.maint (commit): Target removed.
* bootstrap: Don't generate commit.
* HACKING (Release Procedure): Adjusted.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
Gary V. Vaughan 2010-09-01 10:11:40 +07:00
parent 26dacf3464
commit 52c3155962
5 changed files with 16 additions and 399 deletions

View File

@ -1,3 +1,13 @@
2010-09-01 Gary V. Vaughan <gary@gnu.org>
Remove clcommit.m4sh.
* clcommit.m4sh: Removed. This script was written to help keep
ChangeLog and commit messages in sync when committing to CVS,
and is an anachronism now that Libtool uses git.
* Makefile.maint (commit): Target removed.
* bootstrap: Don't generate commit.
* HACKING (Release Procedure): Adjusted.
2010-08-31 Peter Rosin <peda@lysator.liu.se>
archive-in-archive.at passes with Microsoft lib.

View File

@ -647,7 +647,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
and `make distcheck CC=g++'
If there are any problems, fix them and start again.
* Run `./commit -p' from the source tree.
* Run `git commit' from the source tree.
* Run `make -fMakefile.maint git-dist' (or `make -f../Makefile.maint
git-dist' if you are running from a VPATH build directory, where `../'
@ -676,7 +676,9 @@ or obtained by writing to the Free Software Foundation, Inc.,
* Update NEWS, ChangeLog.
* Run `./commit -p --tags', to push the new changes and tags to origin.
* Run `git commit'.
* Run `git push --tags', to push the new changes and tags to origin.
* Update the webpages, libtool.html will need to indicate the latest
release number.

View File

@ -36,17 +36,6 @@ Makefile:
TEXI2HTML = texi2html
$(srcdir)/commit: $(srcdir)/$(auxdir)/mailnotify clcommit.m4sh
$(timestamp); \
cd $(srcdir); \
rm -f commit commit.in commit.tmp; \
$(M4SH) -B $(auxdir) clcommit.m4sh > commit.in; \
$(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" commit.in > commit.tmp; \
chmod a+x commit.tmp; \
chmod a-w commit.tmp; \
mv -f commit.tmp commit; \
rm -f commit.in
announce-gen: $(auxdir)/announce-gen.m4sh $(auxdir)/getopt.m4sh
$(timestamp); \
rm -f announce-gen announce-gen.in announce-gen.tmp; \
@ -73,7 +62,7 @@ $(srcdir)/$(auxdir)/mailnotify: $(auxdir)/mailnotify.m4sh
rm -f mailnotify.in
.PHONY: git-release
git-release: version-check prev-tarball check-news fetch git-commit git-dist diffs web-manual
git-release: version-check prev-tarball check-news fetch git-dist diffs web-manual
@tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
lzmaname="$(PACKAGE)-$(VERSION).tar.lzma"; \
diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
@ -160,10 +149,6 @@ fetch:
GPG = gpg # set it to `:' to avoid gpg operations
.PHONY: git-commit
git-commit: check-news
cd $(srcdir) && $(SHELL) ./commit
.PHONY: git-dist
git-dist: check-news check-commit
## Build the distribution:

View File

@ -140,11 +140,6 @@ $MAKE ./$auxdir/ltmain.sh ./$m4dir/ltversion.m4 \
AUTOTEST="$AUTOM4TE --language=autotest" SED="$SED" MAKEINFO="$MAKEINFO" \
GREP="$GREP" FGREP="$FGREP" EGREP="$EGREP" LN_S="$LN_S"
test -f clcommit.m4sh && $MAKE -f Makefile.maint ./commit \
srcdir=. top_srcdir=. PACKAGE="$PACKAGE" VERSION="$VERSION" \
M4SH="$AUTOM4TE -l m4sh" \
SED="$SED" GREP="$GREP" FGREP="$FGREP" EGREP="$EGREP" LN_S="$LN_S"
rm -f Makefile
# Make a dummy libtoolize script for autoreconf:
@ -193,7 +188,7 @@ done
# Commit script caveat:
cat <<EOF
WARNING: You might want to regenerate \`commit' and \`$auxdir/mailnotify'
WARNING: You might want to regenerate \`$auxdir/mailnotify'
WARNING: after you have run \`configure' to discover the real whereabouts
WARNING: of \`sed', \`grep' etc. like this:
WARNING:

View File

@ -1,375 +0,0 @@
AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])
# clcommit (GNU @PACKAGE@) version 2.1
# Written by Gary V. Vaughan <gary@gnu.org>
# and Alexandre Oliva <aoliva@redhat.com>
# Copyright (C) 1999, 2000, 2004, 2006, 2008, 2009, 2010 Free Software
# Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Clcommit is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Clcommit is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with clcommit; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Usage: $progname [OPTION]... [--] [filepattern ...]
# -a AUTHOR --author=AUTHOR override changeset author name with AUTHOR
# -C FILE --changelog=FILE extract commit message from specified FILE
# --debug enable verbose shell tracing
# -n --dry-run don't commit anything
# --fast same as --force --first
# -F FILE --file=FILE read commit message from FILE
# -1 --first extract first entry from ChangeLog, no git diff
# -f --force don't check (unless *followed* by -n), and just
# display commit message instead of running $PAGER
# --from=ADDRESS override default from ADDRESS in commit email
# -m STRING --message=STRING set commit message to STRING
# --msg=STRING same as -m
# -p --push push the changes back to origin
# -r [FILE] --rcfile[=FILE] read default option from FILE [./.clcommitrc]
# -s ADDR --sendmail=ADDR send commit email of the differences to ADDRESS
# --signature[=FILE] add FILE to the end of the email [~/.signature]
# --signoff add a Signed-off-by attribution at the end
# -S TEXT --summary=TEXT specify a TEXT subject line for the commit email
# --tags in conjunction with -p, also push tags
# -v --verbose run in verbose mode
# --version print version information
# -h,-? --help print short or long help message
# This script eases checking in changes to git-maintained projects
# with ChangeLog files. It will check that there have been no
# conflicting commits in the git 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 working directory are considered for check in.
# The commit message will be extracted from the differences between a
# file named ChangeLog* in the commit list, or named after -C, 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.
# Report bugs to <gary@gnu.org>
: ${GIT="git"}
: ${MAILNOTIFY="mailnotify"}
: ${MKSTAMP="mkstamp"}
test -f "libltdl/config/$MAILNOTIFY" && MAILNOTIFY="libltdl/config/$MAILNOTIFY"
test -f "libltdl/config/$MKSTAMP" && MKSTAMP="libltdl/config/$MKSTAMP"
PROGRAM=clcommit
m4_divert_pop
m4_include([getopt.m4sh])
M4SH_VERBATIM([[
# Locations for important files:
log_dir="`func_mktempdir`"
log_file="$log_dir/log"
push_conflicts="$log_dir/git_push.log"
trap '$RM -r "$log_dir"; exit $EXIT_FAILURE' 1 2 15
# try to find out whether read supports -r
if echo bt | tr b '\\' | { read -r line; test "X$line" = 'X\t'; } 2>/dev/null
then
read_r='read -r'
else
read_r=read
fi
]])
dnl SHORT LONG DEFAULT INIT
dnl ----------------------------------------------------------------------
M4SH_GETOPTS(
[1], [--first], [], [],
[a^!], [--author], [], [
git_flags="${git_flags+$git_flags }--author=$opt_author"],
[C@], [--changelog|--Change[Ll]og], [], [],
[F!], [--file], [], [
cat "[$]1" > "$log_file" || break],
[f], [--force], [], [
PAGER=cat],
[m!], [--message|--msg], [], [
echo "[$]1" > "$log_file"],
[n], [--dry-run|--dryrun], [], [
mailnotify_flags="${mailnotify_flags+$mailnotify_flags }--dry-run"],
[p], [--push], [], [],
[r@?], [--rcfile], [./.clcommitrc], [
# The funny quoting allows keeping one option per line in $opt_rcfile:
eval set dummy `echo \`cat $opt_rcfile\` '${1+"[$]@"}'`
shift],
[S!], [--summary], [], [],
[s^!], [--sendmail], [], [],
[v], [--verbose], [], [
mailnotify_flags="${mailnotify_flags+$mailnotify_flags }--verbose"],
[], [--fast], [], [
set dummy --force --first ${1+"[$]@"}; shift],
[^!], [--from], [], [
mailnotify_flags="${mailnotify_flags+$mailnotify_flags }--from=$opt_from"],
[@?], [--signature], [], [
test -n "$opt_signature" || opt_signature="$HOME/.signature"],
[], [--signoff], [], [
git_flags="${git_flags+$git_flags }$opt"],
[], [--tags], [], [],
[
# pass debug flag along to mailnotify
test "$opt_debug" != ":" &&
mailnotify_flags="${mailnotify_flags+$mailnotify_flags }--debug"
# validate $opt_first, $opt_file and $opt_message
if $opt_first; then
test -n "$opt_file$opt_message" &&
func_error "you can have at most one of -m, -F and -1"
else
test -n "$opt_file" && test -n "$opt_message" &&
func_error "you can have at most one of -m, -F and -1"
fi
# validate $opt_from and $opt_signature
test -n "$opt_sendmail" || {
# can't have a from address without a destination address
test -n "$opt_from" &&
func_error "can't use --from without --sendmail." && exit_cmd=exit
# can't use a signature file without a destination address
test -n "$opt_signature" &&
func_error "can't use --signature without --sendmail." && exit_cmd=exit
}
# validate $opt_tags
$opt_push || {
$opt_tags &&
func_error "can't use --tags without --push." && exit_cmd=exit
}
])
M4SH_VERBATIM([[
# Bail out on command errors!
set -e
# func_check_conflicts
func_check_conflicts ()
{
$opt_debug
func_verbose "checking for commit conflicts..."
if $GIT push --dry-run > "$push_conflicts" 2>&1; then :; else
cat "$push_conflicts" >&2
func_fatal_error "some conflicts were found with upstream repository, aborting..."
fi
}
# func_check_commit_msg
func_check_commit_msg ()
{
$opt_debug
if test -z "$opt_changelog"; then
for f in ${1+"$@"}; do
case "$f" in
ChangeLog* | */ChangeLog*)
if test -z "$opt_changelog"; then
opt_changelog="$f"
else
func_fatal_error "multiple ChangeLog files: $opt_changelog and $f"
fi
;;
esac
done
fi
func_verbose "checking commit message..."
separate_summary=: # whether to separate summary lines for git
if $opt_first; then
skipping=:
$SED 's,^,+,' < ${opt_changelog-ChangeLog} |
while $read_r line; do
case "$line" in
"+") if $skipping; then skipping=false; else break; fi;;
"+ "*)
func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:"
echo "$line" | $SED 's/^.//' >&2;;
"+ *"*) # asterisk marks end of summary line
$skipping || echo "$line"
separate_summary=false ;;
"+ "*".") # summary line must end with a period
$skipping || {
echo "$line"
$separate_summary && echo "+ "
separate_summary=false
};;
"+ "*) # no separator for multiline summary
echo "$line"
separate_summary=false ;;
esac
done |
$SED 's,^\+ ,,' > "$log_file" || exit $EXIT_FAILURE
else
$GIT diff ${opt_changelog-ChangeLog} |
while $read_r line; do
case $line in
"--- "*) :;;
"-"*)
func_error "*** Warning: the following line in ChangeLog diff is suspicious:"
echo "$line" | $SED 's/^.//' >&2;;
"+ "*)
func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:"
echo "$line" | $SED 's/^.//' >&2;;
"+") echo ;;
"+ *"*) # asterisk marks end of summary line
echo "$line"
separate_summary=false ;;
"+ "*".") # summary line must end with a period
echo "$line"
$separate_summary && echo "+ "
separate_summary=false ;;
"+ "*) # no separator for multiline summary
echo "$line"
separate_summary=false ;;
esac
done |
$SED -e 's,\+ ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
|| exit $EXIT_FAILURE
fi
# 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
}
# func_commit
func_commit ()
{
$opt_debug
${PAGER-more} "$log_file" || exit $EXIT_FAILURE
sleep 1 # give the user some time for a ^C
subject=`git status 2>/dev/null | $SED -n 's/^#.*[mad][ode][dl].*ed: *//p'`
test $# -gt 0 && subject="$@"
test $# -gt 0 || { set dummy -a; shift; }
func_show_eval "$GIT commit $git_flags -F $log_file ${1+$@}" "exit $EXIT_FAILURE"
$opt_push && {
func_show_eval "$GIT push"
$opt_tags && func_show_eval "$GIT push --tags"
}
:
}
# func_mailnotify
func_mailnotify ()
{
$opt_debug
notify_file="${log_dir}/notify"
func_verbose "Mailing commit notification to \"$opt_sendmail\""
{
echo Subject: $subject
test -f .git/config &&
echo "Root: `$SED -n 's,^ url = .*:\(.*\)$,\1,p' .git/config`"
test -f $MKSTAMP &&
echo "Timestamp: `$SHELL $MKSTAMP .`"
echo "Branch: `$GIT branch | sed -n 's/\* //p'`"
test -f .git/config &&
echo "Changes by: `$SED -n 's,^ url = \([^:]*\):.*$,\1,p' .git/config`"
echo ""
echo "Log Message:"
$SED -e 's,^, ,' "$log_file"
test -f "$opt_signature" && {
echo '-- '
cat "$opt_signature"
}
} > "$notify_file"
${PAGER-more} "$notify_file" || break
# Break out the subject line again
my_mail_subject=`$SED -e '
1{
s/^Subject: *//
q
}' "$notify_file"`
my_mail_body=`$SED -e '2,$p;d' "$notify_file"`
echo "$my_mail_body" > "$notify_file"
func_quote_for_eval "$my_mail_subject"
func_show_eval "$MAILNOTIFY $mailnotify_flags \
-s $func_quote_for_eval_result -m 'text/plain' -f '$notify_file' \
-- $opt_sendmail"
}
## ----- ##
## main. ##
## ----- ##
{
test -f "$log_file" || func_check_commit_msg
grep '[^ ]' < "$log_file" > /dev/null ||
func_fatal_error "empty commit message, aborting"
# We expect line 2 to be blank, since it separates the git summary line from
# the commit message body, but any others are probably an error:
if sed 2d "$log_file" | grep '^$' > /dev/null; then
func_error "*** Warning: blank lines should not appear within commit messages."
func_error "*** They should be used to separate distinct commits."
fi
# $opt_force says to force the changes through without checking for conflicts
$opt_push && {
$opt_force || func_check_conflicts
}
# 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.
func_commit ${1+"$@"}
# Send a copy of the log_file if opt_sendmail was set:
subject=`sed -n '1p' "$log_file"`
if test -n "$opt_sendmail"; then
if ! $opt_push; then
func_warning "Mail notification NOT sent for commit to local repository."
else
func_mailnotify
fi
fi
$RM -r "$log_dir"
}
exit $EXIT_SUCCESS
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
]])