* [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time @ 2008-02-15 21:53 Jay Soffian 2008-02-15 21:53 ` [PATCH 2/3] mailinfo: support rfc3676 (format=flowed) text/plain messages Jay Soffian 2008-02-15 23:24 ` [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Junio C Hamano 0 siblings, 2 replies; 8+ messages in thread From: Jay Soffian @ 2008-02-15 21:53 UTC (permalink / raw) To: git; +Cc: Jay Soffian, Junio C Hamano, Johannes Schindelin handle_filter() is only supposed to get one line at a time. handle_body() already ensures this after decoding BASE64 messages per this comment: /* this is a decoded line that may contain * multiple new lines. Pass only one chunk * at a time to handle_filter() */ QP messages need to be similarly processed since decoding QP can also add newlines. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> --- I broke this change out into it's own patch since it's independent of the format=flowed additions. builtin-mailinfo.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 2600847..11f154b 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -818,6 +818,7 @@ static void handle_body(void) switch (transfer_encoding) { case TE_BASE64: + case TE_QP: { char *op = line; -- 1.5.4.1.1281.g75df ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] mailinfo: support rfc3676 (format=flowed) text/plain messages 2008-02-15 21:53 [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Jay Soffian @ 2008-02-15 21:53 ` Jay Soffian 2008-02-15 21:53 ` [PATCH 3/3] test mailinfo rfc3676 support Jay Soffian 2008-02-15 23:24 ` [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Junio C Hamano 1 sibling, 1 reply; 8+ messages in thread From: Jay Soffian @ 2008-02-15 21:53 UTC (permalink / raw) To: git; +Cc: Jay Soffian, Junio C Hamano, Johannes Schindelin RFC 3676 establishes two parameters (Format and DelSP) to be used with the Text/Plain media type. In the presence of these parameters, trailing whitespace is used to indicate flowed lines and a canonical quote indicator is used to indicate quoted lines. mailinfo now unfolds, unquotes, and un-space-stuffs such messages. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> --- This is a bit simpler than the previous patch and incorporates most of Johannes' feedback. I also switched from enum's to int's since enum's were really overkill. builtin-mailinfo.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 11f154b..0492baf 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -21,6 +21,10 @@ static enum { TYPE_TEXT, TYPE_OTHER, } message_type; +/* RFC 3676 Text/Plain Format and DelSp Parameters */ +static int message_format_is_flowed; +static int message_delsp_is_yes; + static char charset[256]; static int patch_lines; static char **p_hdr_data, **s_hdr_data; @@ -193,6 +197,15 @@ static int handle_content_type(char *line) if (strcasestr(line, "text/") == NULL) message_type = TYPE_OTHER; + else if (strcasestr(line, "text/plain")) { + char attr[256]; + if ((message_format_is_flowed = ( + slurp_attr(line, "format=", attr) && + !strcasecmp(attr, "flowed")))) + message_delsp_is_yes = ( + slurp_attr(line, "delsp=", attr) && + !strcasecmp(attr, "yes")); + } if (slurp_attr(line, "boundary=", boundary + 2)) { memcpy(boundary, "--", 2); if (content_top++ >= &content[MAX_BOUNDARIES]) { @@ -681,6 +694,8 @@ again: transfer_encoding = TE_DONTCARE; charset[0] = 0; message_type = TYPE_TEXT; + message_format_is_flowed = 0; + message_delsp_is_yes = 0; /* slurp in this section's info */ while (read_one_header_line(line, sizeof(line), fin)) @@ -770,6 +785,22 @@ static int handle_filter(char *line, unsigned linesize) { static int filter = 0; + if (message_format_is_flowed && strcmp(line, "-- \n")) { + /* strip quote markers */ + while (*line && *line == '>') + line++; + /* undo space-stuffing */ + if (*line == ' ') + line++; + if (strcmp(line, "-- \n")) { + char *cp = strchrnul(line, '\n'); + if (cp > line && *(cp-1) == ' ' && *cp == '\n') + /* line is flowed (wrapped); remove + * the \n or <space>\n if delsp is yes + */ + *(cp-(message_delsp_is_yes?1:0)) = '\0'; + } + } /* filter tells us which part we left off on * a non-zero return indicates we hit a filter point */ -- 1.5.4.1.1281.g75df ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] test mailinfo rfc3676 support 2008-02-15 21:53 ` [PATCH 2/3] mailinfo: support rfc3676 (format=flowed) text/plain messages Jay Soffian @ 2008-02-15 21:53 ` Jay Soffian 0 siblings, 0 replies; 8+ messages in thread From: Jay Soffian @ 2008-02-15 21:53 UTC (permalink / raw) To: git; +Cc: Jay Soffian, Junio C Hamano, Johannes Schindelin Adds format=flowed and format=flowed delsp=yes messages to the sample.mbox for testing rfc3676 support. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> --- I added two tests. The previous patch only added one. This also I think does a better job of checking the new code. t/t5100-mailinfo.sh | 2 +- t/t5100/info0009 | 5 ++ t/t5100/info0010 | 5 ++ t/t5100/msg0009 | 12 +++++ t/t5100/msg0010 | 12 +++++ t/t5100/patch0009 | 24 ++++++++++ t/t5100/patch0010 | 24 ++++++++++ t/t5100/sample.mbox | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 205 insertions(+), 1 deletions(-) create mode 100644 t/t5100/info0009 create mode 100644 t/t5100/info0010 create mode 100644 t/t5100/msg0009 create mode 100644 t/t5100/msg0010 create mode 100644 t/t5100/patch0009 create mode 100644 t/t5100/patch0010 diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh index 9b1a745..aaf9889 100755 --- a/t/t5100-mailinfo.sh +++ b/t/t5100-mailinfo.sh @@ -11,7 +11,7 @@ test_expect_success 'split sample box' \ 'git mailsplit -o. ../t5100/sample.mbox >last && last=`cat last` && echo total is $last && - test `cat last` = 8' + test `cat last` = 10' for mail in `echo 00*` do diff --git a/t/t5100/info0009 b/t/t5100/info0009 new file mode 100644 index 0000000..850ee58 --- /dev/null +++ b/t/t5100/info0009 @@ -0,0 +1,5 @@ +Author: Jay Soffian +Email: jaysoffian@example.com +Subject: Add lorum ipsum text +Date: Fri, 15 Feb 2008 21:16:18 -0000 + diff --git a/t/t5100/info0010 b/t/t5100/info0010 new file mode 100644 index 0000000..4a7d931 --- /dev/null +++ b/t/t5100/info0010 @@ -0,0 +1,5 @@ +Author: Jay Soffian +Email: jay@example.com +Subject: Add lorum ipsum text +Date: Fri, 15 Feb 2008 21:15:32 -0000 + diff --git a/t/t5100/msg0009 b/t/t5100/msg0009 new file mode 100644 index 0000000..38e4d57 --- /dev/null +++ b/t/t5100/msg0009 @@ -0,0 +1,12 @@ +The text was added twice, once pre-wrapped, once as a single long line, +which will be flowed. + +The next two lines test for space stuffing: +From nobody +> + +Let's also add some non-ASCII characters: + +â ⡠⢠⣠⤠⥠⦠⧠⨠⩠+ +Signed-off-by: Jay Soffian <jaysoffian@example.com> diff --git a/t/t5100/msg0010 b/t/t5100/msg0010 new file mode 100644 index 0000000..38e4d57 --- /dev/null +++ b/t/t5100/msg0010 @@ -0,0 +1,12 @@ +The text was added twice, once pre-wrapped, once as a single long line, +which will be flowed. + +The next two lines test for space stuffing: +From nobody +> + +Let's also add some non-ASCII characters: + +â ⡠⢠⣠⤠⥠⦠⧠⨠⩠+ +Signed-off-by: Jay Soffian <jaysoffian@example.com> diff --git a/t/t5100/patch0009 b/t/t5100/patch0009 new file mode 100644 index 0000000..946cd9b --- /dev/null +++ b/t/t5100/patch0009 @@ -0,0 +1,24 @@ +--- +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + lorum.txt | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/lorum.txt b/lorum.txt +index cbe5415..c04a705 100644 +--- a/lorum.txt ++++ b/lorum.txt +@@ -1,2 +1,10 @@ + From nobody ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ++tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ++veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea ++commodo consequat. Duis aute irure dolor in reprehenderit in voluptate ++velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint ++occaecat cupidatat non proident, sunt in culpa qui officia deserunt ++mollit anim id est laborum. + > +-- +1.5.4.1.1281.g75df + diff --git a/t/t5100/patch0010 b/t/t5100/patch0010 new file mode 100644 index 0000000..946cd9b --- /dev/null +++ b/t/t5100/patch0010 @@ -0,0 +1,24 @@ +--- +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + lorum.txt | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/lorum.txt b/lorum.txt +index cbe5415..c04a705 100644 +--- a/lorum.txt ++++ b/lorum.txt +@@ -1,2 +1,10 @@ + From nobody ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ++tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ++veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea ++commodo consequat. Duis aute irure dolor in reprehenderit in voluptate ++velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint ++occaecat cupidatat non proident, sunt in culpa qui officia deserunt ++mollit anim id est laborum. + > +-- +1.5.4.1.1281.g75df + diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox index 070c166..895ec7f 100644 --- a/t/t5100/sample.mbox +++ b/t/t5100/sample.mbox @@ -407,3 +407,125 @@ Subject: [PATCH] another patch Hey you forgot the patch! +From jaysoffian Fri Feb 15 21:16:18 2008 +Message-ID: <47B6011E.3070904@example.com> +From: Jay Soffian <jaysoffian@example.com> +User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) +MIME-Version: 1.0 +To: jay@example.com +Subject: [PATCH] Add lorum ipsum text +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 8bit +Date: Fri, 15 Feb 2008 21:16:18 -0000 + +The text was added twice, once pre-wrapped, once as a single long line, +which will be flowed. + +The next two lines test for space stuffing: + From nobody + > + +Let's also add some non-ASCII characters: + +â ⡠⢠⣠⤠⥠⦠⧠⨠⩠+ +Signed-off-by: Jay Soffian <jaysoffian@example.com> +--- +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim +veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +commodo consequat. Duis aute irure dolor in reprehenderit in voluptate +velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint +occaecat cupidatat non proident, sunt in culpa qui officia deserunt +mollit anim id est laborum. + + lorum.txt | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/lorum.txt b/lorum.txt +index cbe5415..c04a705 100644 +--- a/lorum.txt ++++ b/lorum.txt +@@ -1,2 +1,10 @@ + From nobody ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do +eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad +minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip +ex ea commodo consequat. Duis aute irure dolor in reprehenderit in +voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur +sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt +mollit anim id est laborum. ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ++tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ++veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea ++commodo consequat. Duis aute irure dolor in reprehenderit in voluptate ++velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint ++occaecat cupidatat non proident, sunt in culpa qui officia deserunt ++mollit anim id est laborum. + > +-- +1.5.4.1.1281.g75df + +From jaysoffian Fri Feb 15 21:15:32 2008 +Message-Id: <091C406F-24BE-4D13-AD75-0F60F0D1A532@example.com> +From: Jay Soffian <jay@example.com> +To: Jay Soffian <jay@example.com> +Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes +Content-Transfer-Encoding: quoted-printable +Mime-Version: 1.0 (Apple Message framework v919.2) +Subject: [PATCH] Add lorum ipsum text +X-Mailer: Apple Mail (2.919.2) +Date: Fri, 15 Feb 2008 21:15:32 -0000 + +The text was added twice, once pre-wrapped, once as a single long line, +which will be flowed. + +The next two lines test for space stuffing: + =46rom nobody + > + +Let's also add some non-ASCII characters: + +=E2=91=A0 =E2=91=A1 =E2=91=A2 =E2=91=A3 =E2=91=A4 =E2=91=A5 =E2=91=A6 = +=E2=91=A7 =E2=91=A8 =E2=91=A9 + +Signed-off-by: Jay Soffian <jaysoffian@example.com> +--- +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do =20 +eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad =20= + +minim veniam, quis nostrud exercitation ullamco laboris nisi ut =20 +aliquip ex ea commodo consequat. Duis aute irure dolor in =20 +reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla =20 +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in =20 +culpa qui officia deserunt mollit anim id est laborum. + + lorum.txt | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/lorum.txt b/lorum.txt +index cbe5415..c04a705 100644 +--- a/lorum.txt ++++ b/lorum.txt +@@ -1,2 +1,10 @@ + =46rom nobody ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do =20 +eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad =20= + +minim veniam, quis nostrud exercitation ullamco laboris nisi ut =20 +aliquip ex ea commodo consequat. Duis aute irure dolor in =20 +reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla =20 +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in =20 +culpa qui officia deserunt mollit anim id est laborum. ++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do =20 +eiusmod ++tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ++veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea ++commodo consequat. Duis aute irure dolor in reprehenderit in voluptate ++velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint ++occaecat cupidatat non proident, sunt in culpa qui officia deserunt ++mollit anim id est laborum. + > +--=20 +1.5.4.1.1281.g75df + -- 1.5.4.1.1281.g75df ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time 2008-02-15 21:53 [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Jay Soffian 2008-02-15 21:53 ` [PATCH 2/3] mailinfo: support rfc3676 (format=flowed) text/plain messages Jay Soffian @ 2008-02-15 23:24 ` Junio C Hamano 2008-02-15 23:37 ` Jay Soffian 1 sibling, 1 reply; 8+ messages in thread From: Junio C Hamano @ 2008-02-15 23:24 UTC (permalink / raw) To: Jay Soffian; +Cc: git, Johannes Schindelin Jay Soffian <jaysoffian@gmail.com> writes: > handle_filter() is only supposed to get one line at a time. > handle_body() already ensures this after decoding BASE64 messages per > this comment: > > /* this is a decoded line that may contain > * multiple new lines. Pass only one chunk > * at a time to handle_filter() > Good eyes. Although I do not think we need to quote in-code comments here ;-) > QP messages need to be similarly processed since decoding QP can also > add newlines. > > Signed-off-by: Jay Soffian <jaysoffian@gmail.com> > --- > I broke this change out into it's own patch since it's independent of > the format=flowed additions. > > builtin-mailinfo.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c > index 2600847..11f154b 100644 > --- a/builtin-mailinfo.c > +++ b/builtin-mailinfo.c > @@ -818,6 +818,7 @@ static void handle_body(void) > > switch (transfer_encoding) { > case TE_BASE64: > + case TE_QP: > { > char *op = line; > And it appears to be an obvious fix that should even go to 'maint' where no new features will land. Care to provide a test case for this one? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time 2008-02-15 23:24 ` [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Junio C Hamano @ 2008-02-15 23:37 ` Jay Soffian 2008-02-16 6:17 ` Junio C Hamano 0 siblings, 1 reply; 8+ messages in thread From: Jay Soffian @ 2008-02-15 23:37 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Johannes Schindelin On Feb 15, 2008 6:24 PM, Junio C Hamano <gitster@pobox.com> wrote: > And it appears to be an obvious fix that should even go to > 'maint' where no new features will land. Yes. > Care to provide a test case for this one? I'll see what I can do. I'm not sure it makes a difference w/o my format=flowed additions, so there may not be a test case, but I'll poke it with a stick some more. -- j. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time 2008-02-15 23:37 ` Jay Soffian @ 2008-02-16 6:17 ` Junio C Hamano 2008-02-16 6:22 ` Junio C Hamano 2008-02-16 6:51 ` Jay Soffian 0 siblings, 2 replies; 8+ messages in thread From: Junio C Hamano @ 2008-02-16 6:17 UTC (permalink / raw) To: Jay Soffian; +Cc: Junio C Hamano, git, Johannes Schindelin "Jay Soffian" <jaysoffian@gmail.com> writes: > On Feb 15, 2008 6:24 PM, Junio C Hamano <gitster@pobox.com> wrote: >> And it appears to be an obvious fix that should even go to >> 'maint' where no new features will land. > > Yes. > >> Care to provide a test case for this one? > > I'll see what I can do. I'm not sure it makes a difference... Of course it does; otherwise I wouldn't have asked. Thanks for the fix. The following will go to 'maint'. -- >8 -- From: Jay Soffian <jaysoffian@gmail.com> Date: Fri, 15 Feb 2008 16:53:36 -0500 Subject: mailinfo: feed only one line to handle_filter() for QP input The function is intended to be fed one logical line at a time to inspect, but a QP encoded raw input line can have more than one lines, just like BASE64 encoded one. Quoting LF as =0A may be unusual but RFC2045 allows it. The issue was noticed and fixed by Jay Soffian. JC added a test to protect the fix from regressing later. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- builtin-mailinfo.c | 1 + t/t5100-mailinfo.sh | 2 +- t/t5100/info0009 | 5 +++++ t/t5100/msg0009 | 2 ++ t/t5100/patch0009 | 13 +++++++++++++ t/t5100/sample.mbox | 23 +++++++++++++++++++++++ 6 files changed, 45 insertions(+), 1 deletions(-) diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 2600847..11f154b 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -818,6 +818,7 @@ static void handle_body(void) switch (transfer_encoding) { case TE_BASE64: + case TE_QP: { char *op = line; diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh index 9b1a745..d6c55c1 100755 --- a/t/t5100-mailinfo.sh +++ b/t/t5100-mailinfo.sh @@ -11,7 +11,7 @@ test_expect_success 'split sample box' \ 'git mailsplit -o. ../t5100/sample.mbox >last && last=`cat last` && echo total is $last && - test `cat last` = 8' + test `cat last` = 9' for mail in `echo 00*` do diff --git a/t/t5100/info0009 b/t/t5100/info0009 new file mode 100644 index 0000000..2a66321 --- /dev/null +++ b/t/t5100/info0009 @@ -0,0 +1,5 @@ +Author: F U Bar +Email: f.u.bar@example.com +Subject: updates +Date: Mon, 17 Sep 2001 00:00:00 +0900 + diff --git a/t/t5100/msg0009 b/t/t5100/msg0009 new file mode 100644 index 0000000..9ffe131 --- /dev/null +++ b/t/t5100/msg0009 @@ -0,0 +1,2 @@ +This is to fix diff-format documentation. + diff --git a/t/t5100/patch0009 b/t/t5100/patch0009 new file mode 100644 index 0000000..304cd55 --- /dev/null +++ b/t/t5100/patch0009 @@ -0,0 +1,13 @@ +diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt +index b426a14..97756ec 100644 +--- a/Documentation/diff-format.txt ++++ b/Documentation/diff-format.txt +@@ -81,7 +81,7 @@ The "diff" formatting options can be customized via the + environment variable 'GIT_DIFF_OPTS'. For example, if you + prefer context diff: + +- GIT_DIFF_OPTS=-c git-diff-index -p $(cat .git/HEAD) ++ GIT_DIFF_OPTS=-c git-diff-index -p HEAD + + + 2. When the environment variable 'GIT_EXTERNAL_DIFF' is set, the diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox index 070c166..b9bd90d 100644 --- a/t/t5100/sample.mbox +++ b/t/t5100/sample.mbox @@ -407,3 +407,26 @@ Subject: [PATCH] another patch Hey you forgot the patch! +From nobody Mon Sep 17 00:00:00 2001 +From: A U Thor <a.u.thor@example.com> +Date: Mon, 17 Sep 2001 00:00:00 +0900 +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: Quoted-Printable + +=0A=0AFrom: F U Bar <f.u.bar@example.com> +Subject: [PATCH] updates=0A=0AThis is to fix diff-format documentation. + +diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt +index b426a14..97756ec 100644 +--- a/Documentation/diff-format.txt ++++ b/Documentation/diff-format.txt +@@ -81,7 +81,7 @@ The "diff" formatting options can be customized via the + environment variable 'GIT_DIFF_OPTS'. For example, if you + prefer context diff: +=20 +- GIT_DIFF_OPTS=3D-c git-diff-index -p $(cat .git/HEAD) ++ GIT_DIFF_OPTS=3D-c git-diff-index -p HEAD +=20 +=20 + 2. When the environment variable 'GIT_EXTERNAL_DIFF' is set, the ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time 2008-02-16 6:17 ` Junio C Hamano @ 2008-02-16 6:22 ` Junio C Hamano 2008-02-16 6:51 ` Jay Soffian 1 sibling, 0 replies; 8+ messages in thread From: Junio C Hamano @ 2008-02-16 6:22 UTC (permalink / raw) To: Jay Soffian; +Cc: git, Johannes Schindelin Junio C Hamano <gitster@pobox.com> writes: > The function is intended to be fed one logical line at a time to > inspect, but a QP encoded raw input line can have more than one > lines, just like BASE64 encoded one. > > Quoting LF as =0A may be unusual but RFC2045 allows it. Well, this is a bit dark-gray. The canonical line ending CRLF should not be represented as =0A and the intention of RFC2045 seems to allow =0A only as part of binary contents. So strictly speaking this may not be needed, but there may always be not quite conforming MUA that would break the assumption and would bite us, so we'd better be safe than sorry. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time 2008-02-16 6:17 ` Junio C Hamano 2008-02-16 6:22 ` Junio C Hamano @ 2008-02-16 6:51 ` Jay Soffian 1 sibling, 0 replies; 8+ messages in thread From: Jay Soffian @ 2008-02-16 6:51 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Johannes Schindelin On Feb 16, 2008 1:17 AM, Junio C Hamano <gitster@pobox.com> wrote: > "Jay Soffian" <jaysoffian@gmail.com> writes: > > > On Feb 15, 2008 6:24 PM, Junio C Hamano <gitster@pobox.com> wrote: > >> Care to provide a test case for this one? > > > > I'll see what I can do. I'm not sure it makes a difference... > > Of course it does; otherwise I wouldn't have asked. What I meant was, I wasn't sure if the output of mailinfo would have been incorrect w/o the patch. I noticed it only when I added the format=flowed code which relied on handle_filter() getting a single line at a time. I hadn't looked at whether handle_commit_msg() and/or handle_patch() (downstream of handle_filter) would care. I wasn't trying to shirk off adding a test case. :-) j. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-02-16 6:52 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-15 21:53 [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Jay Soffian 2008-02-15 21:53 ` [PATCH 2/3] mailinfo: support rfc3676 (format=flowed) text/plain messages Jay Soffian 2008-02-15 21:53 ` [PATCH 3/3] test mailinfo rfc3676 support Jay Soffian 2008-02-15 23:24 ` [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time Junio C Hamano 2008-02-15 23:37 ` Jay Soffian 2008-02-16 6:17 ` Junio C Hamano 2008-02-16 6:22 ` Junio C Hamano 2008-02-16 6:51 ` Jay Soffian
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).