[PATCH] Use parsed subject for mboxes
Veronika Kabatova
vkabatov at redhat.com
Mon Apr 9 23:00:13 AEST 2018
----- Original Message -----
> From: "Daniel Axtens" <dja at axtens.net>
> To: "Stephen Finucane" <stephen at that.guru>, patchwork at lists.ozlabs.org
> Sent: Sunday, April 8, 2018 5:21:48 AM
> Subject: Re: [PATCH] Use parsed subject for mboxes
>
> Stephen Finucane <stephen at that.guru> writes:
>
> > With a recent change, we started using the original subject header
> > instead of the one we had already cleaned up at the parsing stage.
>
> Does anyone care about the cleaned up header in the mbox? Git strips it
> all off anyway... Is there any docs on why we did things that way
> originally?
>
I agree with Daniel and Johannes. For the mboxes, we should use the original
subject for consistency with the original patch sent. Scripts might get
confused by the difference, and there might be ones requiring "PATCH" in the
subject etc. Unless there is an important reason to use parsed subject in the
mbox, I'd rather revert this and fix the tests. Especially as it's not even
the mbox tests that fail (which I've run) but the bundles tests using the
patch's name to assert the patch was added to the bundle (using
X-Patchwork-Id for those tests would be more appropriate choice).
Veronika
> Regards,
> Daniel
>
> > Revert this aspect of that change.
> >
> > Signed-off-by: Stephen Finucane <stephen at that.guru>
> > Fixes: 01b9cbb9 ("Include all email headers in mboxes")
> > ---
> > patchwork/views/utils.py | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/patchwork/views/utils.py b/patchwork/views/utils.py
> > index f5ff43c1..7f89004b 100644
> > --- a/patchwork/views/utils.py
> > +++ b/patchwork/views/utils.py
> > @@ -101,6 +101,9 @@ def _submission_to_mbox(submission):
> > for key, val in orig_headers.items():
> > mail[key] = val
> >
> > + # specifically overwrite the subject with our own nicely formatted
> > name
> > + mail['Subject'] = submission.name
> > +
> > if 'Date' not in mail:
> > mail['Date'] = email.utils.formatdate(utc_timestamp)
> >
> > --
> > 2.14.3
> >
> > _______________________________________________
> > Patchwork mailing list
> > Patchwork at lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/patchwork
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork
>
More information about the Patchwork
mailing list