[PATCH 5/5] series: fix obvious breakage for patches with ']' in the name

Stephen Finucane stephen at that.guru
Thu Jul 13 19:09:59 AEST 2017


On Wed, 2017-07-12 at 11:28 -0700, Sean Farley wrote:
> Stephen Finucane <stephen at that.guru> writes:
> 
> > On Tue, 2017-07-11 at 11:41 -0700, Sean Farley wrote:
> > > This copies the same regex that parse uses to find the name. Perhaps
> > > future work should abstract this into a common method.
> > > 
> > > Signed-off-by: Sean Farley <sean at farley.io>

[snip]

> > 
> > I'll admit, I initially thought this was wrong. The above will only handle
> > a single prefix (e.g. '[xxx] subject') and I thought you'd want to handle
> > multiple prefixes (e.g. '[xxx] [yyy] subject'). However, we don't store the
> > raw subject in 'Submission.name' - rather, we take the original subject and
> > clean it up, and then store this [1]. After this cleanup, the subject is
> > formatted [2] as such:
> > 
> >   [xxx,yyy,...] subject
> > 
> > ...so we'd only ever have to strip one set of prefixes.
> > 
> > > @property
> > > def received_total(self):
> > 
> > I've added a note to the above effect and applied the patch.
> 
> Oh, that's some nice analysis; thanks! I found the whole series name
> definition to be a bit wonky. Is there a definition of what it should
> be?

Yeah, we use (a) user-defined names, (b) cover letter subjects (without tags),
and (c) the subject of the first patch to hand (without tags), in that order of
preference. The comment in 'patchwork.models.Series.add_cover_letter' [1]
explains this in detail. The commit this was added in [2] might also be worth
checking out.

Hope this helps,
Stephen

[1] https://github.com/getpatchwork/patchwork/blob/master/patchwork/models.py#L
654-L666
[2] https://github.com/getpatchwork/patchwork/commit/d67d859f40f49b3c10efe5fdbf
f54797bdd7ccec


More information about the Patchwork mailing list