From patchwork Fri Dec 13 04:28:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Worth X-Patchwork-Id: 300875 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 1E5B62C019B for ; Fri, 13 Dec 2013 15:28:13 +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 324CA2C00A6 for ; Fri, 13 Dec 2013 15:28:09 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 810C06DE169E for ; Thu, 12 Dec 2013 20:28:06 -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 8ZzM_Lr6TX9Y; Thu, 12 Dec 2013 20:28:02 -0800 (PST) Received: from yoom.home.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 3B9B36DE026D; Thu, 12 Dec 2013 20:28:02 -0800 (PST) From: Carl Worth To: patchwork@lists.ozlabs.org Subject: [PATCH] post-receive: Fix error message when pushing to an unmapped branch Date: Thu, 12 Dec 2013 20:28:02 -0800 Message-Id: <1386908882-9666-1-git-send-email-cworth@cworth.org> X-Mailer: git-send-email 1.8.4.rc3 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" Previously, if STATE_MAP contained only refs/heads/master and a user pushed to a branch such as refs/heads/stable, the hook emitted a misleading error message: E: no mapping for refname refs/heads/master Fix this by correctly printing the reference being looked for, rather than the reference most recently found in STATE_MAP. Also, reword the message slightly to point the user to STATE_MAP and to use an actual word "branch" instead of the non-word "refname". --- tools/post-receive.hook | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/post-receive.hook b/tools/post-receive.hook index d0b8e22..94387ab 100755 --- a/tools/post-receive.hook +++ b/tools/post-receive.hook @@ -67,6 +67,6 @@ while read oldrev newrev refname; do fi done if [ $found -eq 0 ]; then - echo "E: no mapping for refname $key" >&2 + echo "E: STATE_MAP has no mapping for branch $refname" >&2 fi done