Re: [BUG PATCH RFC] mailinfo: correctly handle multiline 'Subject:' header
- From
Kirill Smelkov <kirr@landau.phys.spbu.ru>
- Date
- Jan 7, 2009, 22:43 UTC
- Message-ID
- <20090107224342.GB4946@roro3>
- In-Reply-To
- <1230316721-14339-1-git-send-email-kirr@mns.spb.ru>
On Fri, Dec 26, 2008 at 09:38:41PM +0300, Kirill Smelkov wrote:
Show 7 quoted lines
> When native language (RU) is in use, subject header usually contains several > parts, e.g. > > Subject: [Navy-patches] [PATCH] > =?utf-8?b?0JjQt9C80LXQvdGR0L0g0YHQv9C40YHQvtC6INC/0LA=?= > =?utf-8?b?0LrQtdGC0L7QsiDQvdC10L7QsdGF0L7QtNC40LzRi9GFINC00LvRjyA=?= > =?utf-8?b?0YHQsdC+0YDQutC4?=
Which btw should be extracted by git-mailinfo to:
'Subject: Изменён список пакетов необходимых для сборки'
Show 36 quoted lines
> This exposes several bugs in builtin-mailinfo.c that I try to fix: > > > 1. decode_b_segment: do not append explicit NUL -- explicit NUL was preventing > correct header construction on parts concatenation via strbuf_addbuf in > decode_header_bq. Fixes: > > -Subject: Изменён список пакетов необходимых для сборки > +Subject: Изменён список па > > > Then > > 2. (hackish) do not emit '\n' after processing of every header segment. It > seems we should emit previous part as-is only if it does not end with > '=?='. Fixes: > > -Subject: Изменён список пакетов необходимых для сборки > +Subject: Изменён список па кетов необходимых для сборки > > > Sorry for low-quality patch and description. I did what I could and don't have > energy and time dig more into MIME. > > Please help. > > Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> > > --- > builtin-mailinfo.c | 18 ++++++++++++++++- > t/t5100-mailinfo.sh | 2 +- > t/t5100/info0012 | 5 ++++ > t/t5100/msg0012 | 7 ++++++ > t/t5100/patch0012 | 30 +++++++++++++++++++++++++++++ > t/t5100/sample.mbox | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 6 files changed, 112 insertions(+), 2 deletions(-)
Junio, All,
What about this patch?
It at least exposes bug in git-mailinfo wrt handling of multiline subjects, and in very details documents it and adds a test for it.
Yes, my fixes are of 'low quality', but may I try to attract git community attention one more time?
Thanks beforehand, Kirill
P.S. original post with patch:
http://marc.info/?l=git&m=123031899307286&w=2