[RFC] Updating patchwork patches on commit

Siddhesh Poyarekar siddhesh@gotplt.org
Wed Dec 16 18:49:30 GMT 2020


On 12/17/20 12:05 AM, Girish Joshi wrote:
> Hello all,
> I tried a couple of very basic scripts for this. (I know that there
> are a lot of improvements needed there.)
> I was able to merge 336 series out of 1114.

I'm surprised there are 1114 series that need action; maybe it's 
including series that have already been committed and you need to filter 
those out?

> As "git-pw patch apply <id>" gives "Resource not found" for the older
> patches. So right now only series are applied to a branch.
> Here is how the scripts work.
> We have two scripts, "get-patches.py" and "apply-patches.py" (we can
> change the names of course).
> "get-patches.py" reads the patches/series starting from page1 to page
> 100 (currently) in csv format and dumps it to stdout. This output is
> piped to the second script "apply-patches.py" which tries to apply
> each series/patch to the branch.

It should become one script.

> In the end we get two files as an output "merged.txt" and
> "unmerged.txt" containing the IDs for merged and unmerged series
> respectively.
> Currently these files are placed in the current directory, I'll change
> it to /tmp or something else in the next patch.
> 
> Just to have it here, to apply patches using these two scripts
> 
>      $ python scripts/get-patches.py series | python
> scripts/apply-patches.py series apply
> 
> I'm still not sure about what happens to the older patches, do they
> get applied from "git-pw series apply" or not (I'm looking into it)
> because the newer ones do get applied.

The older ones do not have a series ID because they were ported over 
from an ancient patchwork instance, so they won't work with `git-pw 
series`.  They'll need some trickery to figure out series.  There ought 
to be some relationship beyond the name, say, in the mbox of the patch 
that could be exploited to make that connection.

Siddhesh


More information about the Libc-alpha mailing list