Re: scripts interaction of Patchwork and Git

2010-01-24 Thread Jeremy Kerr
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
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork


Re: scripts interaction of Patchwork and Git

2010-01-23 Thread Carl-Daniel Hailfinger
On 23.01.2010 17:03, Paul Menzel wrote:
 OpenEmbedded [2] is using Git for source code management and Patchwork
 for patch tracking. Just today `pwclient` was mentioned on the list
 while we were thinking about easier interaction with Patchwork. So a lot
 of feature are probably unknown to us.

 Jeremy mentioned he has some scripts in [1]. Unfortunately I could not
 find those searching for
 »site:http://lists.ozlabs.org/pipermail/patchwork git scripts«.

 Could you please help out and publish your scripts/tools?

I think I already posted my script for patchwork handling of flashrom
svn, but here it is again (needs tweaking for other SCMs and projects,
and my local paths are hardcoded). There are two calls in there to
generate patches with -p0 and -p1 because some people send -p1 patches
(mostly Git users) and others send -p0 patches (mostly Subversion users).

Bugs/limitations of my script:
- The patchwork hash is sensitive to file order, and git creates patches
in a different order than svn. This causes lookups for multi-file
patches to fail if the submitter used svn and the tree is in git or vice
versa.
- The patchwork hash sometimes won't match if the patch was applied with
an offset (a few lines down or up).
- There is no attempt to use the project as qualifier in case a patch
was sent to multiple lists and thus a patch may match multiple patchwork
IDs.

Ah yes. Here's the link to the archived post:
http://lists.ozlabs.org/pipermail/patchwork/2009-October/000173.html

Regards,
Carl-Daniel

-- 
Developer quote of the year:
We are juggling too many chainsaws and flaming arrows and tigers.

___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork