scripts interaction of Patchwork and Git

Jeremy Kerr jk at ozlabs.org
Mon Jan 25 08:55:03 EST 2010


Paul,

> Before I send other question in a separate threads I was wondering if
> you could share your scripts you all wrote to make your life easier as
> for example Git hooks.

OK, in the interests of writing stuff down, this is what I have:

* A hook in .git/hooks/post-applypatch:

 #!/bin/bash

 sha=$(git rev-parse HEAD)
 hash=$(git show $sha | pwparser --hash)
 pwclient update -s Accepted -c $sha -h $hash

* A 'catchup' script, to mark a range of revs as accepted:

 #!/bin/bash

 git rev-list "$@" |
 while read commit
 do
     hash=$(git show $commit | pwparser --hash)
     pwclient update -h $hash -s Accepted -c $commit
 done

Note that pwparser is a symbolic link from ~/bin/pwparser to 
$patchwork/apps/bin/patchwork/parser.py. I need to work out a nicer way to 
distribute the parser code. Once that is done, I'll these to the online help.

Cheers,


Jeremy


More information about the Patchwork mailing list