Re: [PATCH 2/5] git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jun 2, 2010, 04:30 UTC
- Message-ID
- <20100602043046.GB8245@progeny.tock>
- In-Reply-To
- <Wt_M4qptcPdpY0Q3jqUbfP4zZEkPwPt44bpwlkuoHdyyNRTiITmTBE-eGA_-F-7NiaN6W4MRrlA@cipher.nrlssc.navy.mil>
Brandon Casey wrote:
Show 5 quoted lines
> 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.
Also, the MinGW port ignores -e on a #! line, so we should not rely on it.
Show 5 quoted lines
> --- a/git-request-pull.sh > +++ b/git-request-pull.sh > @@ -1,4 +1,4 @@ > -#!/bin/sh -e > +#!/bin/sh
To maintain the old behavior, I think we would need something like this:
-- 8< -- Subject: request-pull: more explicit error handling
git request-pull includes -e on its #! line to catch miscellaneous errors, but most of the body of the script explicitly handles errors. Finish the job so we can remove the -e.
Suggested-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> ---
diff --git a/git-request-pull.sh b/git-request-pull.sh index 6dfb885..6fdea39 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -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