From 87ab799234639c26ea10de74782fa511cb3ca606 Mon Sep 17 00:00:00 2001 From: Don Zickus Date: Mon, 12 Mar 2007 15:52:04 -0400 Subject: builtin-mailinfo.c infrastrcture changes I am working on a project that required parsing through regular mboxes that didn't necessarily have patches embedded in them. I started by creating my own modified copy of git-am and working from there. Very quickly, I noticed git-mailinfo wasn't able to handle a big chunk of my email. After hacking up numerous solutions and running into more limitations, I decided it was just easier to rewrite a big chunk of it. The following patch has a bunch of fixes and features that I needed in order for me do what I wanted. Note: I'm didn't follow any email rfc papers but I don't think any of the changes I did required much knowledge (besides the boundary stuff). List of major changes/fixes: - can't create empty patch files fix - empty patch files don't fail, this failure will come inside git-am - multipart boundaries are now handled - only output inbody headers if a patch exists otherwise assume those headers are part of the reply and instead output the original headers - decode and filter base64 patches correctly - various other accidental fixes I believe I didn't break any existing functionality or compatibility (other than what I describe above, which is really only the empty patch file). I tested this through various mailing list archives and everything seemed to parse correctly (a couple thousand emails). [jc: squashed in another patch from Don's five patch series to fix the test case, as this patch exposes the bug in the test.] Signed-off-by: Don Zickus Signed-off-by: Junio C Hamano --- t/t5100/patch0005 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t5100') diff --git a/t/t5100/patch0005 b/t/t5100/patch0005 index 7d24b24af8..e7d6f66608 100644 --- a/t/t5100/patch0005 +++ b/t/t5100/patch0005 @@ -61,7 +61,7 @@ diff --git a/git-cvsimport-script b/git-cvsimport-script push(@old,$fn); -- -David Kågedal +David KÃ¥gedal - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org -- cgit v1.2.3 From ae1a7437355a1fbc907b6d6cad9ed79227c29164 Mon Sep 17 00:00:00 2001 From: Don Zickus Date: Mon, 12 Mar 2007 15:52:07 -0400 Subject: Add a couple more test cases to the suite. They handle cases where there is no attached patch. Signed-off-by: Don Zickus Signed-off-by: Junio C Hamano --- t/t5100/info0007 | 5 +++++ t/t5100/info0008 | 5 +++++ t/t5100/msg0007 | 2 ++ t/t5100/msg0008 | 4 ++++ t/t5100/patch0007 | 0 t/t5100/patch0008 | 0 t/t5100/sample.mbox | 18 ++++++++++++++++++ 7 files changed, 34 insertions(+) create mode 100644 t/t5100/info0007 create mode 100644 t/t5100/info0008 create mode 100644 t/t5100/msg0007 create mode 100644 t/t5100/msg0008 create mode 100644 t/t5100/patch0007 create mode 100644 t/t5100/patch0008 (limited to 't/t5100') diff --git a/t/t5100/info0007 b/t/t5100/info0007 new file mode 100644 index 0000000000..49bb0fec85 --- /dev/null +++ b/t/t5100/info0007 @@ -0,0 +1,5 @@ +Author: A U Thor +Email: a.u.thor@example.com +Subject: another patch +Date: Fri, 9 Jun 2006 00:44:16 -0700 + diff --git a/t/t5100/info0008 b/t/t5100/info0008 new file mode 100644 index 0000000000..e8a2951383 --- /dev/null +++ b/t/t5100/info0008 @@ -0,0 +1,5 @@ +Author: Junio C Hamano +Email: junio@kernel.org +Subject: another patch +Date: Fri, 9 Jun 2006 00:44:16 -0700 + diff --git a/t/t5100/msg0007 b/t/t5100/msg0007 new file mode 100644 index 0000000000..71b23c0236 --- /dev/null +++ b/t/t5100/msg0007 @@ -0,0 +1,2 @@ +Here is an empty patch from A U Thor. + diff --git a/t/t5100/msg0008 b/t/t5100/msg0008 new file mode 100644 index 0000000000..a80ecb97ef --- /dev/null +++ b/t/t5100/msg0008 @@ -0,0 +1,4 @@ +>Here is an empty patch from A U Thor. + +Hey you forgot the patch! + diff --git a/t/t5100/patch0007 b/t/t5100/patch0007 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/t/t5100/patch0008 b/t/t5100/patch0008 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox index 86bfc27147..b80c981c16 100644 --- a/t/t5100/sample.mbox +++ b/t/t5100/sample.mbox @@ -386,3 +386,21 @@ index 9123cdc..918dcf8 100644 -- 1.4.0.g6f2b +From nobody Mon Sep 17 00:00:00 2001 +From: A U Thor +Date: Fri, 9 Jun 2006 00:44:16 -0700 +Subject: [PATCH] another patch + +Here is an empty patch from A U Thor. + +From nobody Mon Sep 17 00:00:00 2001 +From: Junio C Hamano +Date: Fri, 9 Jun 2006 00:44:16 -0700 +Subject: re: [PATCH] another patch + +From: A U Thor +Subject: [PATCH] another patch +>Here is an empty patch from A U Thor. + +Hey you forgot the patch! + -- cgit v1.2.3