Re: [PATCH 2/5] git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brandon Casey wrote:

> 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.

> --- 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@xxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]