All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] git-am: fixed patch_format detection according to RFC2822
@ 2009-09-25 15:14 Christian Himpel
  2009-09-25 15:17 ` [PATCH 2/2] git-am: force egrep to use correct characters set Christian Himpel
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Himpel @ 2009-09-25 15:14 UTC (permalink / raw)
  To: git

RFC2822 specifies in paragraph 3.6.8, that optional header fields are
made up of any printable US-ASCII character except ' ' (space) and ':'
(colon).

The pattern for the egrep command is changed to match all of these
characters.

Signed-off-by: Christian Himpel <chressie@gmail.com>
---

Hi,

I had a problem with applying a patch with 'git am', because the one
header fields in the patch-e-mail contained numbers.  So I read the
RFC2822 what they say about header fields.  Unbelievable but any
printable character except space and colon are allowed in header fields.
So I changed the egrep expression according to this rule.

Regards,
chressie


 git-am.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index 26ffe70..0ddd80f 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -205,7 +205,7 @@ check_patch_format () {
 			# and see if it looks like that they all begin with the
 			# header field names...
 			sed -n -e '/^$/q' -e '/^[ 	]/d' -e p "$1" |
-			egrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||
+			egrep -v '^[!-9;-~]+:' >/dev/null ||
 			patch_format=mbox
 		fi
 	} < "$1" || clean_abort
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-09-28 12:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-25 15:14 [PATCH 1/2] git-am: fixed patch_format detection according to RFC2822 Christian Himpel
2009-09-25 15:17 ` [PATCH 2/2] git-am: force egrep to use correct characters set Christian Himpel
2009-09-25 15:45   ` [PATCH 2/2 v2] " Christian Himpel
2009-09-25 16:43     ` [PATCH] " Christian Himpel
2009-09-27  7:40       ` Jeff King
2009-09-28  6:55         ` Christian Himpel
2009-09-28  7:16           ` Jeff King
2009-09-28  8:12         ` Johannes Sixt
2009-09-28  9:32           ` Christian Himpel
2009-09-28  9:53             ` Johannes Sixt
2009-09-28 12:09               ` Christian Himpel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.