From: Brian Norris Date: Tue, 22 Jul 2014 12:45:07 -0700 Subject: [U-Boot] A way to change the status of the whole series on Patchwork ? In-Reply-To: <20140722135051.GR1847@bill-the-cat> References: <20140717111942.0EC5.AA925319@jp.panasonic.com> <20140717024909.GX7537@ld-irv-0074> <20140722135051.GR1847@bill-the-cat> Message-ID: <20140722194507.GD28323@ld-irv-0074> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jul 22, 2014 at 09:50:51AM -0400, Tom Rini wrote: > On Wed, Jul 16, 2014 at 07:49:09PM -0700, Brian Norris wrote: > > On Thu, Jul 17, 2014 at 11:19:42AM +0900, Masahiro Yamada wrote: > > > Does Patchwork have any good way to change the status > > > of the whole series? > > > > You can use pwclient via scripts. (I wrote my own hooks for mutt so I > > can do quicker management straight from my mailbox.) > > Oooh, can you share? Thanks! It's kind of an ugly patchwork (pun!) of Python, shell, etc., so it's not beautiful to share. But the core of it is that I pipe an email to a Python script to extract the Message-ID, then pipe that to pwclient for tasks. Note that the patch "hash" [1] is severely unreliable [2], since it's easy to have collisions; this left me with using e-mail Message-ID, which is much more likely to be unique. The Python tidbit simplifies to this: import sys from email import message_from_file print message_from_file(sys.stdin)['Message-Id'] Then some sort of grepping/regex/etc. can get you the patchwork ID from the Message-ID. e.g.: pwclient list -m "$MESSAGEID" | awk '{print $1;}' | grep '[0-9][0-9]*' After which you can do your magic with: pwclient Unfortunately, this is two round trips to the patchwork server, but that's the best I have for now. My .muttrc has bindings like this: set pipe_split=yes macro index,pager A "~/scripts/mutt-patchwork-apply" macro index,pager S "~/scripts/mutt-patchwork-status" macro index,pager I "~/scripts/mutt-patchwork-info" HTH. Brian [1] patchwork.git has a parser script (apps/patchwork/parser.py), which can give you the patchwork patch hash: parser.py --hash [2] I note the problem with hash collisions here, but I didn't get any response: https://lists.ozlabs.org/pipermail/patchwork/2014-May/001019.html