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

2 messages from 2009-07-14 to 2009-07-14. Participants: Nicolas Sebrecht, Giuseppe Bilotta.
Thread: https://gitlist.dev/t/20105

## Nicolas Sebrecht, 2009-07-14 06:39

Subject: [PATCH] git-am: print fair error message when format detection fails
Message-ID: <beef9dfceed12f279bc27fbecf82118761cada49.1247553436.git.ni.s@laposte.net>
URL: https://gitlist.dev/e/beef9dfceed12f279bc27fbecf82118761cada49.1247553436.git.ni.s%40laposte.net

```
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."
+		fi
 		;;
 	esac
 }
-- 
1.6.4.rc0.121.g2937a.dirty

```

## Giuseppe Bilotta, 2009-07-14 07:10

Subject: Re: [PATCH] git-am: print fair error message when format detection fails
Message-ID: <cb7bb73a0907140010o42e9d67di8e871dccb8b41ed4@mail.gmail.com>
URL: https://gitlist.dev/e/cb7bb73a0907140010o42e9d67di8e871dccb8b41ed4%40mail.gmail.com
In-Reply-To: <beef9dfceed12f279bc27fbecf82118761cada49.1247553436.git.ni.s@laposte.net>

```
On Tue, Jul 14, 2009 at 8:39 AM, Nicolas Sebrecht<ni.s@laposte.net> wrote:
> 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?

> +               fi
>                ;;
>        esac
>  }
> --
> 1.6.4.rc0.121.g2937a.dirty



-- 
Giuseppe "Oblomov" Bilotta

```
