threads / patch / 20105

patchgit-am: print fair error message when format detection fails

Subject: [PATCH] git-am: print fair error message when format detection fails

## tl;dr

2 messages between Jul 14, 2009 and Jul 14, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Nicolas Sebrecht· Jul 14, 2009, 06:39 UTC · lore
Avoid git ending with this message:
	"Patch format  is not supported."
Signed-off-by: Nicolas Sebrecht <ni.s@laposte.net>
---
 git-am.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Show changes to git-am.sh +5 −1
diff --git a/git-am.sh b/git-am.sh
index d64d997..ca73c88 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -254,7 +254,11 @@ split_patches () {
 		msgnum=
 		;;
 	*)
-		clean_abort "Patch format $patch_format is not supported."
+		if test -n "$parse_patch" ; then
+			clean_abort "Patch format $patch_format is not supported."
+		else
+			clean_abort "Format patch detection failed."
+		fi
 		;;
 	esac
 }
-- 
1.6.4.rc0.121.g2937a.dirty
Giuseppe Bilotta· Jul 14, 2009, 07:10 UTC · re: Nicolas Sebrecht · lore

Re: [PATCH] git-am: print fair error message when format detection fails

On Tue, Jul 14, 2009 at 8:39 AM, Nicolas Sebrecht<ni.s@laposte.net> wrote:
Show 21 quoted lines
> Avoid git ending with this message:
>        "Patch format  is not supported."
>
> Signed-off-by: Nicolas Sebrecht <ni.s@laposte.net>
> ---
>  git-am.sh |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/git-am.sh b/git-am.sh
> index d64d997..ca73c88 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -254,7 +254,11 @@ split_patches () {
>                msgnum=
>                ;;
>        *)
> -               clean_abort "Patch format $patch_format is not supported."
> +               if test -n "$parse_patch" ; then
> +                       clean_abort "Patch format $patch_format is not supported."
> +               else
> +                       clean_abort "Format patch detection failed."
"Patch format detection failed" maybe?
Show 6 quoted lines
> +               fi
>                ;;
>        esac
>  }
> --
> 1.6.4.rc0.121.g2937a.dirty
-- 
Giuseppe "Oblomov" Bilotta

← back to recent threads