Add untested git push conflict testing to commit script.

* clcommit.m4sh (func_check_conflicts): Test return status
of 'git push --dry-run', and display an error on non-zero.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
Gary V. Vaughan 2008-09-07 19:53:16 +08:00
parent 35bd5f3176
commit 96e199bd51
2 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,9 @@
2008-09-07 Gary V. Vaughan <gary@gnu.org>
Add untested git push conflict testing to commit script.
* clcommit.m4sh (func_check_conflicts): Test return status
of 'git push --dry-run', and display an error on non-zero.
Enable release procedure to work with lzma OLDRELEASE file.
* Makefile.maint (diffs, prev-tarball, new-tarball): If lzma
tarballs are present use them to generate the diffs, otherwise

View File

@ -110,6 +110,7 @@ fi
signature_file=
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
@ -289,9 +290,9 @@ set -e
# func_check_conflicts
func_check_conflicts ()
{
# HELP?!? How to check for git push conflicts?
if false; then
func_fatal_error "some conflicts were found with CVS repository, aborting..."
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
}
@ -420,8 +421,6 @@ func_mailnotify ()
## ----- ##
{
$opt_update && func_check_conflicts
test -f "$log_file" || func_check_commit_msg
grep '[^ ]' < "$log_file" > /dev/null ||
@ -432,15 +431,16 @@ func_mailnotify ()
func_error "*** They should be used to separate distinct commits."
fi
$opt_update && $opt_push && 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.
if $opt_commit; then
func_commit ${1+"$@"}
fi
subject=`sed -n '1p' "$log_file"`
# Send a copy of the log_file if sendmail_to was set:
subject=`sed -n '1p' "$log_file"`
if test -n "$sendmail_to"; then
if ! $opt_push; then
func_warning "Mail notification NOT sent for commit to local repository."