From patchwork Thu Dec 3 19:40:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 7762751 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C4DE9F1C2 for ; Thu, 3 Dec 2015 19:42:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60DF8204AB for ; Thu, 3 Dec 2015 19:42:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2F568204A0 for ; Thu, 3 Dec 2015 19:42:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A78556E3A8; Thu, 3 Dec 2015 11:42:13 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id DB4A06E3A8 for ; Thu, 3 Dec 2015 11:42:12 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 03 Dec 2015 11:42:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,378,1444719600"; d="scan'208";a="853378072" Received: from kldumlao-mobl3.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.254.179.188]) by fmsmga001.fm.intel.com with ESMTP; 03 Dec 2015 11:42:11 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 3 Dec 2015 17:40:50 -0200 Message-Id: <1449171651-30872-1-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.6.2 Cc: Jani Nikula Subject: [Intel-gfx] [maintainer-tools PATCH 1/2] dim: use quotes when testing for empty string X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Today I applied/pushed patches for the first time, and noticed that all my commits had exactly this: Link: http://patchwork.freedesktop.org/patch/msgid/ without the actual ID there. I assumed the ID would be set by some commit hook since our hooks seem to be able to talk to patchwork. Looks like I was wrong. It seems that I was supposed to apply a patch email, not the original patch file that I sent with git send-email. The problem happened due to missing quotes around $message_id: pzanoni@panetone:~/nfs/teste$ cat test.sh #!/bin/bash A="" if [ -n $A ]; then echo "No quotes: true" else echo "No quotes: false" fi if [ -n "$A" ]; then echo "With quotes: true" else echo "With quotes: false" fi pzanoni@panetone:~/nfs/teste$ bash test.sh No quotes: true With quotes: false In addition, print a little message telling us that the message-ids are missing. This may help by reminding us that we should apply the mail file, not the original patch. I'm not enforcing it since I don't know all our use cases. Cc: Jani Nikula Signed-off-by: Paulo Zanoni Reviewed-by: Jani Nikula --- dim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dim b/dim index 78b3f30..5f2f686 100755 --- a/dim +++ b/dim @@ -382,8 +382,10 @@ function dim_apply cat $file | git am -3 "$@" - if [ -n $message_id ]; then + if [ -n "$message_id" ]; then commit_add_tag "Link" "http://patchwork.freedesktop.org/patch/msgid/$message_id" + else + echo "No message-id found in the patch file." fi eval $DRY $DIM_POST_APPLY_ACTION