From patchwork Wed Mar 15 15:09:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 9625901 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 669D360424 for ; Wed, 15 Mar 2017 15:09:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A4D12863E for ; Wed, 15 Mar 2017 15:09:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EF602864A; Wed, 15 Mar 2017 15:09:11 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 873EC2863E for ; Wed, 15 Mar 2017 15:09:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 919FE6E8EA; Wed, 15 Mar 2017 15:09:09 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6838F6E8EA for ; Wed, 15 Mar 2017 15:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489590548; x=1521126548; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2r1W49YVr6JQ2AiXNQGnFSukcEcf9iip3BEr4edYIPQ=; b=WEq1+Y13fSwatHycvfXV9y8ppa0DVzBpK1pNwBRbUsSRtn9K72/KqKj6 F++QkOGNULHAy8ajTX15chdDycLhGQ==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2017 08:09:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,169,1486454400"; d="scan'208"; a="1122888111" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 15 Mar 2017 08:09:05 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 15 Mar 2017 17:09:04 +0200 From: ville.syrjala@linux.intel.com To: intel-gfx@lists.freedesktop.org Date: Wed, 15 Mar 2017 17:09:04 +0200 Message-Id: <20170315150904.3374-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170314185014.8635-1-ville.syrjala@linux.intel.com> References: <20170314185014.8635-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH dim v2 1/2] dim: Add extract-tags command 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Add a command for extracting various tags (eg. Reviwed-by:) from emails. You can give the comamnd a rangeish to add the tags from the same email to multiple already applied patches. The regexp used to pick up tags is purposefully quite broad. People tend to typo these things, or add extra whitespace etc. However the broad regexp does mean this occasionally picks up stuff that isn't a tag. So manually amending the commit is probably a wise idea, and so I simply decided to also leave a '--- extracted tags ---' separator in the commit message just before the extracted tags, which can be cleaned up manually when verifying that the tags look correct. v2: Drop the aliases Remove the temp file Clean up locals Other codingstyle cleanups Use '# *** ... ***' for the separator Cc: Jani Nikula Signed-off-by: Ville Syrjälä --- dim | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/dim b/dim index 6d3b9734b348..8d76953d1746 100755 --- a/dim +++ b/dim @@ -333,6 +333,28 @@ if message_id is not None: EOF } +message_print_body () +{ + python2 < $file + + tags=$(message_print_body "$file" | grep -ai '^[^>]*[A-Za-z-]\+: [^ ]') + + rm -f $file + + if [[ -z "$tags" ]]; then + return 0 + fi + + tags=$(printf -- "# *** extracted tags ***\n%s" "$tags") + + git filter-branch -f --msg-filter "cat ; echo \"$tags\"" $range +} + +function dim_extract_queued +{ + dim_extract_tags drm-intel-next-queued "$@" +} + +function dim_extract_fixes +{ + dim_extract_tags drm-intel-fixes "$@" +} + +function dim_extract_next_fixes +{ + dim_extract_tags drm-intel-next-fixes "$@" +} + dim_alias_check_patch=checkpatch dim_alias_cp=checkpatch function dim_checkpatch