1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-20 08:29:58 +02:00

Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.1

* ks/maint-1.6.0-mailinfo-folded:
  mailinfo: tests for RFC2047 examples
  mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)'
  mailinfo: 'From:' header should be unfold as well
  mailinfo: correctly handle multiline 'Subject:' header
This commit is contained in:
Junio C Hamano 2009-03-12 21:44:00 -07:00
commit e89b991a7f
22 changed files with 229 additions and 10 deletions

View File

@ -430,13 +430,6 @@ static struct strbuf *decode_b_segment(const struct strbuf *b_seg)
c -= 'a' - 26;
else if ('0' <= c && c <= '9')
c -= '0' - 52;
else if (c == '=') {
/* padding is almost like (c == 0), except we do
* not output NUL resulting only from it;
* for now we just trust the data.
*/
c = 0;
}
else
continue; /* garbage */
switch (pos++) {
@ -514,7 +507,25 @@ static int decode_header_bq(struct strbuf *it)
rfc2047 = 1;
if (in != ep) {
strbuf_add(&outbuf, in, ep - in);
/*
* We are about to process an encoded-word
* that begins at ep, but there is something
* before the encoded word.
*/
char *scan;
for (scan = in; scan < ep; scan++)
if (!isspace(*scan))
break;
if (scan != ep || in == it->buf) {
/*
* We should not lose that "something",
* unless we have just processed an
* encoded-word, and there is only LWS
* before the one we are about to process.
*/
strbuf_add(&outbuf, in, ep - in);
}
in = ep;
}
/* E.g.
@ -860,6 +871,7 @@ static void handle_info(void)
}
output_header_lines(fout, "Subject", hdr);
} else if (!memcmp(header[i], "From", 4)) {
cleanup_space(hdr);
handle_from(hdr);
fprintf(fout, "Author: %s\n", name.buf);
fprintf(fout, "Email: %s\n", email.buf);

View File

@ -11,7 +11,7 @@ test_expect_success 'split sample box' \
'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
test `cat last` = 11'
test `cat last` = 13'
for mail in `echo 00*`
do
@ -26,6 +26,28 @@ do
'
done
test_expect_success 'split box with rfc2047 samples' \
'mkdir rfc2047 &&
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
>rfc2047/last &&
last=`cat rfc2047/last` &&
echo total is $last &&
test `cat rfc2047/last` = 11'
for mail in `echo rfc2047/00*`
do
test_expect_success "mailinfo $mail" '
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
echo msg &&
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
echo patch &&
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
echo info &&
test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
'
done
test_expect_success 'respect NULs' '
git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&

0
t/t5100/empty Normal file
View File

5
t/t5100/info0012 Normal file
View File

@ -0,0 +1,5 @@
Author: Dmitriy Blinov
Email: bda@mnsspb.ru
Subject: Изменён список пакетов необходимых для сборки
Date: Wed, 12 Nov 2008 17:54:41 +0300

5
t/t5100/info0013 Normal file
View File

@ -0,0 +1,5 @@
Author: A U Thor
Email: a.u.thor@example.com
Subject: a patch
Date: Fri, 9 Jun 2006 00:44:16 -0700

7
t/t5100/msg0012 Normal file
View File

@ -0,0 +1,7 @@
textlive-* исправлены на texlive-*
docutils заменён на python-docutils
Действительно, оказалось, что rest2web вытягивает за собой
python-docutils. В то время как сам rest2web не нужен.
Signed-off-by: Dmitriy Blinov <bda@mnsspb.ru>

0
t/t5100/msg0013 Normal file
View File

30
t/t5100/patch0012 Normal file
View File

@ -0,0 +1,30 @@
---
howto/build_navy.txt | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/howto/build_navy.txt b/howto/build_navy.txt
index 3fd3afb..0ee807e 100644
--- a/howto/build_navy.txt
+++ b/howto/build_navy.txt
@@ -119,8 +119,8 @@
- libxv-dev
- libusplash-dev
- latex-make
- - textlive-lang-cyrillic
- - textlive-latex-extra
+ - texlive-lang-cyrillic
+ - texlive-latex-extra
- dia
- python-pyrex
- libtool
@@ -128,7 +128,7 @@
- sox
- cython
- imagemagick
- - docutils
+ - python-docutils
#. на машине dinar: добавить свой открытый ssh-ключ в authorized_keys2 пользователя ddev
#. на своей машине: отредактировать /etc/sudoers (команда ``visudo``) примерно следующим образом::
--
1.5.6.5

0
t/t5100/patch0013 Normal file
View File

View File

@ -0,0 +1,4 @@
Author: Keith Moore
Email: moore@cs.utk.edu
Subject: If you can read this you understand the example.

View File

@ -0,0 +1,4 @@
Author: Olle Järnefors
Email: ojarnef@admin.kth.se
Subject: Time for ISO 10646?

View File

@ -0,0 +1,4 @@
Author: Patrik Fältström
Email: paf@nada.kth.se
Subject: RFC-HDR care and feeding

View File

@ -0,0 +1,4 @@
Author: Nathaniel Borenstein (םולש ןב ילטפנ)
Email: nsb@thumper.bellcore.com
Subject: Test of new header generator

View File

@ -0,0 +1,2 @@
Subject: (a)

View File

@ -0,0 +1,2 @@
Subject: (a b)

View File

@ -0,0 +1,2 @@
Subject: (ab)

View File

@ -0,0 +1,2 @@
Subject: (ab)

View File

@ -0,0 +1,2 @@
Subject: (ab)

View File

@ -0,0 +1,2 @@
Subject: (a b)

View File

@ -0,0 +1,2 @@
Subject: (a b)

View File

@ -0,0 +1,48 @@
From nobody Mon Sep 17 00:00:00 2001
From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
From nobody Mon Sep 17 00:00:00 2001
From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>
To: ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se
Subject: Time for ISO 10646?
From nobody Mon Sep 17 00:00:00 2001
To: Dave Crocker <dcrocker@mordor.stanford.edu>
Cc: ietf-822@dimacs.rutgers.edu, paf@comsol.se
From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>
Subject: Re: RFC-HDR care and feeding
From nobody Mon Sep 17 00:00:00 2001
From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
(=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
To: Greg Vaudreuil <gvaudre@NRI.Reston.VA.US>, Ned Freed
<ned@innosoft.com>, Keith Moore <moore@cs.utk.edu>
Subject: Test of new header generator
MIME-Version: 1.0
Content-type: text/plain; charset=ISO-8859-1
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= b)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?=
=?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a_b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)

View File

@ -2,7 +2,10 @@
From nobody Mon Sep 17 00:00:00 2001
From: A U Thor <a.u.thor@example.com>
From: A
U
Thor
<a.u.thor@example.com>
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: [PATCH] a commit.
@ -501,3 +504,60 @@ index 3e5fe51..aabfe5c 100644
--=-=-=--
From bda@mnsspb.ru Wed Nov 12 17:54:41 2008
From: Dmitriy Blinov <bda@mnsspb.ru>
To: navy-patches@dinar.mns.mnsspb.ru
Date: Wed, 12 Nov 2008 17:54:41 +0300
Message-Id: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>
X-Mailer: git-send-email 1.5.6.5
MIME-Version: 1.0
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: 8bit
Subject: [Navy-patches] [PATCH]
=?utf-8?b?0JjQt9C80LXQvdGR0L0g0YHQv9C40YHQvtC6INC/0LA=?=
=?utf-8?b?0LrQtdGC0L7QsiDQvdC10L7QsdGF0L7QtNC40LzRi9GFINC00LvRjyA=?=
=?utf-8?b?0YHQsdC+0YDQutC4?=
textlive-* исправлены на texlive-*
docutils заменён на python-docutils
Действительно, оказалось, что rest2web вытягивает за собой
python-docutils. В то время как сам rest2web не нужен.
Signed-off-by: Dmitriy Blinov <bda@mnsspb.ru>
---
howto/build_navy.txt | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/howto/build_navy.txt b/howto/build_navy.txt
index 3fd3afb..0ee807e 100644
--- a/howto/build_navy.txt
+++ b/howto/build_navy.txt
@@ -119,8 +119,8 @@
- libxv-dev
- libusplash-dev
- latex-make
- - textlive-lang-cyrillic
- - textlive-latex-extra
+ - texlive-lang-cyrillic
+ - texlive-latex-extra
- dia
- python-pyrex
- libtool
@@ -128,7 +128,7 @@
- sox
- cython
- imagemagick
- - docutils
+ - python-docutils
#. на машине dinar: добавить свой открытый ssh-ключ в authorized_keys2 пользователя ddev
#. на своей машине: отредактировать /etc/sudoers (команда ``visudo``) примерно следующим образом::
--
1.5.6.5
From nobody Mon Sep 17 00:00:00 2001
From: <a.u.thor@example.com> (A U Thor)
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: [PATCH] a patch