From patchwork Wed Dec 11 18:46:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Worth X-Patchwork-Id: 300286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id C2A3C2C02FE for ; Thu, 12 Dec 2013 05:55:33 +1100 (EST) Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E810F2C00D7 for ; Thu, 12 Dec 2013 05:55:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 20BC76DE16B0 for ; Wed, 11 Dec 2013 10:46:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at arlo.cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4S6vur438_gO; Wed, 11 Dec 2013 10:46:29 -0800 (PST) Received: from yoom.home.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 174A86DE16AD; Wed, 11 Dec 2013 10:46:29 -0800 (PST) From: Carl Worth To: patchwork@lists.ozlabs.org Subject: [PATCH 2/3] Make the post-receive hook more efficient (using pwclient info, not view) Date: Wed, 11 Dec 2013 10:46:27 -0800 Message-Id: <1386787588-2074-2-git-send-email-cworth@cworth.org> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1386787588-2074-1-git-send-email-cworth@cworth.org> References: <1386787588-2074-1-git-send-email-cworth@cworth.org> X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" 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). --- tools/post-receive.hook | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/post-receive.hook b/tools/post-receive.hook index b2b89a2..d0b8e22 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 -p mesa -h $1 2>/dev/null \ + | sed -rne 's,- id[[:space:]]*: ,,p') echo $id test -n "$id" }