Re: Git pull ack emails..

From: Michael Ellerman
Date: Thu Nov 01 2018 - 06:18:39 EST


Mark Brown <broonie@xxxxxxxxxx> writes:

> On Fri, Oct 26, 2018 at 12:36:14PM -0500, Rob Herring wrote:
>> On Thu, Oct 25, 2018 at 9:14 AM Linus Torvalds
>> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>> > Are there other situations where you might want to track something
>> > _outside_ of a pull request? Maybe. I can't really think of a lot of
>> > them, though. Patches etc don't have commit ID's to track, but it
>
> patchwork gives them IDs and lets you do lookups using them, that's what
> I'm doing. You can get the ID from a git commit by piping the output of
> git show into parser.py from the patchwork source, it works a lot of the
> time but things like editing the commit message will break it (this is a
> theme with my scripting around the mail stuff...).
>
>> submissions. For example, with Greg and Mark B you can expect an
>> automated replies. Mark's reply gets threaded with the original, but
>> Greg's do not. For networking, you may or may not get a manual reply,
>
> Mine *mostly* gets threaded, it's relying on being able to talk to
> patchwork to figure out the message ID at the minute so if the patchwork
> lookup fails for whatever reason it'll just use on what's in the commit
> for the CC list and not thread. That isn't ideal, especially when I'm
> travelling and my network connection isn't the best, I keep meaning to
> try to figure out a better way which would probably be based on git
> notes as discussed earlier.

Yeah I use git notes for this.

When I apply a patch I record the patchwork id in a git note, I have a
custom hacked pwclient that does it automatically. I also download the
full mbox from patchwork and stash it in .git/patchwork/<patch id>.

Then I have everything I need to generate a properly threaded reply to
the original mail.

The git notes work well, if you add the following to your .git/config:

[notes]
rewriteRef = refs/notes/*
displayRef = refs/notes/*

Then all notes are copied when you rewrite a commit (rebase), and also
displayed by eg. git show.

Every now and then if you do extensive rebasing/splitting you get
commits with the wrong or no patchwork ids. But that's pretty rare and
not that hard to fixup when it happens.

There's a slightly sanitised version of some of my scripts here:
https://github.com/mpe/patchwork-scripts

cheers