[RFC] Updating patchwork patches on commit

Girish Joshi girish946@gmail.com
Wed Dec 16 18:35:38 GMT 2020


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.

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.
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.

Is it going in the right direction? Please share your thoughts.
Thanks.

Girish Joshi
girishjoshi.io

On Tue, Dec 8, 2020 at 3:40 PM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>
> On 12/8/20 2:38 PM, Andreas Schwab wrote:
> >> It doesn't; it has it's own hashing function where it normalizes spaces
> >> and newline chars to avoid false negatives.
> >
> > Like git patch-id?
> >
>
> Yeah, except that it (AFAICT) doesn't order the diff input like git
> patch-id does :)  I suppose I could check if they're willing to add a
> dependency on git for this and drop their custom hasher or at least
> provide a supported way to add a different hashing function or program.
>
> Siddhesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-patches.py
Type: text/x-python
Size: 286 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20201217/68ed80fb/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apply-patches.py
Type: text/x-python
Size: 3382 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20201217/68ed80fb/attachment-0001.py>


More information about the Libc-alpha mailing list