diff options
author | Carl Worth <cworth@cworth.org> | 2013-12-11 10:46:27 -0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-01-29 17:57:12 +0800 |
commit | 6dd987e40d5d76dc96ed641723c2ece3f024f85e (patch) | |
tree | 05bdaaac33bd120776a3d22b942879b5a490adce /tools | |
parent | 2b8be9316ca488c8ce913d47dd6f0ad04e7544e8 (diff) | |
download | patchwork-6dd987e40d5d76dc96ed641723c2ece3f024f85e.tar.bz2 patchwork-6dd987e40d5d76dc96ed641723c2ece3f024f85e.tar.xz |
Make the post-receive hook more efficient (using pwclient info, not view)
Older versions of patchwork shipped with a version of pwclient that
had the view command, but not info command. Now that info exists, it's
inefficient to use it to obtain the patchwork ID value, (since it
requires the server to send the entire patch content in response to an
XML RPC request).
So be kind to the server by using info instead, (which has a small,
fixed-length response).
Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/post-receive.hook | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/post-receive.hook b/tools/post-receive.hook index b2b89a2..4f76fa6 100755 --- a/tools/post-receive.hook +++ b/tools/post-receive.hook @@ -25,8 +25,8 @@ get_patchwork_hash() get_patch_id() { local id - id=$($PWDIR/bin/pwclient view -h $1 2>/dev/null \ - | sed -rne 's,X-Patchwork-Id: ,,p') + id=$($PWDIR/bin/pwclient info -h $1 2>/dev/null \ + | sed -rne 's,- id[[:space:]]*: ,,p') echo $id test -n "$id" } |