From patchwork Wed May 9 21:28:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 10390865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A2D3560153 for ; Wed, 9 May 2018 21:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92EEE28774 for ; Wed, 9 May 2018 21:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 875302877E; Wed, 9 May 2018 21:28:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2BBAD28774 for ; Wed, 9 May 2018 21:28:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CEBE6E242; Wed, 9 May 2018 21:28:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0250C6E242 for ; Wed, 9 May 2018 21:28:48 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 14:28:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,382,1520924400"; d="scan'208";a="48013522" Received: from ldmartin-desk.jf.intel.com ([10.24.10.74]) by FMSMGA003.fm.intel.com with ESMTP; 09 May 2018 14:28:48 -0700 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Date: Wed, 9 May 2018 14:28:33 -0700 Message-Id: <20180509212833.15285-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.17.0 Subject: [Intel-gfx] [PATCH] dim: replace pipe commands with single sed X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP A single sed can do the job of taking the second line after a match and it looks simpler. Signed-off-by: Lucas De Marchi Reviewed-by: Daniel Vetter --- I noticed this while reviewing "[PATCH 2/4] dim: shut up sed broken pipe noise in apply-pull". dim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dim b/dim index 6b684ba5308c..f7cf255db3e1 100755 --- a/dim +++ b/dim @@ -924,7 +924,7 @@ function dim_apply_pull cat > $file - pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1) + pull_branch=$(sed -ne '/[gG]it repository at:$/{n;n;p}' $file) if [[ -z "$pull_branch" ]] ; then echoerr "no pull request found"