@matheusbsbs / matheus-bagliano / commits / 53dfac44c9
Fork 0

git-request-pull.sh: remove -e switch to shell interpreter which breaks 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>

Brandon Casey committed Jun 1, 2010 at 19:13 UTC 53dfac44c93d5861f0ab60fc38e1a2d3b67e8c62
1 file changed +6 -6
git-request-pull.sh
+6 -6
@@ -1,4 +1,4 @@
1 -#!/bin/sh -e
1 +#!/bin/sh
2 # Copyright 2005, Ryan Anderson <ryan@michonline.com>
3 #
4 # This file is licensed under the GPL v2, or a later version
@@ -70,10 +70,10 @@ git show -s --format='The following changes since commit %H:
70
71 %s (%ci)
72
73 -are available in the git repository at:' $baserev
74 -echo " $url $branch"
75 -echo
73 +are available in the git repository at:' $baserev &&
74 +echo " $url $branch" &&
75 +echo &&
76
77 -git shortlog ^$baserev $headrev
78 -git diff -M --stat --summary $patch $merge_base..$headrev
77 +git shortlog ^$baserev $headrev &&
78 +git diff -M --stat --summary $patch $merge_base..$headrev || exit
79 exit $status