[U-Boot] Include patchwork patch ID in commit message?

Albert ARIBAUD albert.u.boot at aribaud.net
Sun Jan 31 16:59:31 CET 2016


Hello Masahiro,

On Fri, 29 Jan 2016 18:57:28 +0900, Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
> 2016-01-29 14:14 GMT+09:00 Heiko Schocher <hs at denx.de>:
> > Hello Joe,
> >
> >
> > Am 28.01.2016 um 16:15 schrieb Joe Hershberger:
> >>
> >> Hi Heiko,
> >>
> >> On Thu, Jan 28, 2016 at 12:39 AM, Heiko Schocher <hs at denx.de> wrote:
> >>>
> >>> Hello Tom,
> >>>
> >>> Am 28.01.2016 um 00:45 schrieb Tom Rini:
> >>>>
> >>>>
> >>>> On Wed, Jan 27, 2016 at 05:15:17PM -0600, Joe Hershberger wrote:
> >>>>>
> >>>>>
> >>>>> On Wed, Jan 27, 2016 at 4:22 PM, Tom Rini <trini at konsulko.com> wrote:
> >>>>>>
> >>>>>>
> >>>>>> On Wed, Jan 27, 2016 at 03:08:09PM -0600, Joe Hershberger wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>> Hi Tom,
> >>>>>>>
> >>>>>>> I'm playing with the idea of including the patchwork patch ID in the
> >>>>>>> commit message of each commit that I apply to provide better
> >>>>>>> cross-reference ability.
> >>>>>>>
> >>>>>>> * Access to comments on patches
> >>>>>>> * Clarity on exactly which version of a patch was applied
> >>>>>>> * No need to search by patch subject
> >>>>>>>
> >>>>>>> Here is an example in a working branch:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> http://git.denx.de/?p=u-boot/u-boot-net.git;a=commit;h=48f9a0c786d0a3cbfdf45846567deaebe27a334a
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> I'd prfer Patchwork or Patchwork-ID or something not just Patch.
> >>>>>
> >>>>>
> >>>>>
> >>>>> Would it be more or less compelling if it had a format similar this?
> >>>>>
> >>>>> Patchwork: https://patchwork.ozlabs.org/patch/571773/
> >>>>
> >>>>
> >>>>
> >>>> Yes.
> >>>
> >>>
> >>>
> >>> Sorry, for dummy question ... what should I see in the above link?
> >>
> >>
> >> The link is the think to see, not what it points to. The idea is that
> >> instead of just the patch number, include the patch number in a full
> >> URL for even easier access to the patch.
> >
> >
> > Uh, ah, got it ... I think the patchworks patchnumber would be enough.
> > I like Bins proposal, that patchwork add it automatically ...
> 
> 
> 
> X-Patchwork-Id: 561384
> 
> I assume this tag points to the last version which was actually
> applied to the git tree.

It points to the message in Patchwork -- patchwork does not apply
patches on any tree; in fact, patchwork is totally unrelated to git.

> If you want to know the whole history of each patch,
> you should see former versions as well as the last one.
> 
> The last version is often mature,
> so it may end up with just having "Applied to u-boot/master, thanks!",
> which does not carry useful information at all.

The last message in the thread started by the patch will have this. But
that last message will be unknown by patchwork, which only records
patches [apart from rare false positive cases where PW thinks a message
is a patch, because there is git diff extract pasted into it].

> Nor do I want to see something as follows.
> X-Pachwork-Id-v1: 561184
> X-Pachwork-Id-v2: 561284
> X-Pachwork-Id-v3: 561384

AFAICT, patchwork is not able tell which patch is the vN-1 of a given vN
patch, and probably never will, as there is in fact no reliable way to
reconstruct this. A vN patch does not necessarily have the same subject
line as its vN-1, and does not necessarily have its vN-1's message-Id
listed in its 'Reference:' header.

So you would never see the above anyway.

What I have personally set up recently is a Python script which
goes through my Claws Mail U-Boot mail directory and, for each mail,
queries Patchwork with the Message-ID and, failing that, with each
Reference in turn, and adds X-Patchwork-{id,delegate,state...} to the
mail. There is some ad hoc logic for things like cover letters, and of
course, a caching mechanism so that I query PW only once per message-ID
-- so for a long thread about a single patch, there will be a single
actual query.

Oh, and it adds both an X-Patchwork-Id and an W-Patchwork-URL. :)

I run this regularly on my U-Boot inbox.

(if anyone knows how to query patchwork for "details for every patch
which has changed since the date I last asked", let me know.)

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list