Skip to content

Commit

Permalink
git-request-pull.sh: remove -e switch to shell interpreter which brea…
Browse files Browse the repository at this point in the history
…ks ksh

The -e option causes the shell to exit immediately when a command exits
with a non-zero exit status.  This does not seem to cause a problem for
Bash, but it does cause a problem for the Korn shell, like Solaris's
xpg4/sh, whose unset utility returns non-zero if it is passed a variable
name which was not previously set.  When using xpg4/sh, git-request-pull
exits while sourcing git-sh-setup since git-sh-setup tries to unset the
CDPATH environment variable.

When git-request-pull was originally written, it did not do any error
checking and it used this shell feature to exit when an error occurred.
This script now performs proper error checking and provides useful error
messages, so this -e option appears to be merely a historical artifact and
can be removed.

Kudos to Jonathan Nieder for introducing t5150 which exercises the
request-pull code path.

Suggested-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Jun 2, 2010
1 parent 2bf1033 commit 53dfac4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions git-request-pull.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh
# Copyright 2005, Ryan Anderson <ryan@michonline.com>
#
# This file is licensed under the GPL v2, or a later version
Expand Down Expand Up @@ -70,10 +70,10 @@ git show -s --format='The following changes since commit %H:
%s (%ci)
are available in the git repository at:' $baserev
echo " $url $branch"
echo
are available in the git repository at:' $baserev &&
echo " $url $branch" &&
echo &&

git shortlog ^$baserev $headrev
git diff -M --stat --summary $patch $merge_base..$headrev
git shortlog ^$baserev $headrev &&
git diff -M --stat --summary $patch $merge_base..$headrev || exit
exit $status

0 comments on commit 53dfac4

Please sign in to comment.