From patchwork Thu Oct 22 09:36:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 7463861 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 672E3BEEA4 for ; Thu, 22 Oct 2015 09:33:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D389209A9 for ; Thu, 22 Oct 2015 09:33:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AC6042097A for ; Thu, 22 Oct 2015 09:33:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0103D6EF72; Thu, 22 Oct 2015 02:33:29 -0700 (PDT) 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 ESMTP id E5ACC6EF72 for ; Thu, 22 Oct 2015 02:33:27 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 22 Oct 2015 02:33:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,181,1444719600"; d="scan'208";a="832863898" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.67]) by fmsmga002.fm.intel.com with ESMTP; 22 Oct 2015 02:33:25 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Thu, 22 Oct 2015 12:36:57 +0300 Message-Id: <1445506617-12111-1-git-send-email-jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: jani.nikula@intel.com Subject: [Intel-gfx] [maintainer-tools PATCH] dim: print branches containing commit-ish if no tag contains it 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, 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 dim tc is useful for checking when and where a commit has landed, so one can decide where, for example, a fix to that commit should be queued. If the commit is not in a tagged upstream Linux release, fall back to printing the i915 upstream development branches that contain it. Signed-off-by: Jani Nikula --- dim | 8 +++++++- dim.rst | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dim b/dim index bd7cae828ee7..3bd5b759f8a7 100755 --- a/dim +++ b/dim @@ -808,7 +808,13 @@ case "$subcommand" in ;; tc) cd $DIM_PREFIX/$DIM_DRM_INTEL - git tag --contains $1 | grep ^v | sort -V | head -n 1 + tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) + if [[ -n "$tag" ]]; then + echo "$tag" + else + # not in a tagged release, show branches + git branch --contains $1 drm-intel-* master topic/* | sed 's/^[ \*]*//' + fi ;; check-patch|cp) dim_checkrange $@ diff --git a/dim.rst b/dim.rst index ebbc04bc3604..a1da6e0b4621 100644 --- a/dim.rst +++ b/dim.rst @@ -174,7 +174,8 @@ Apply a patch to the i-g-t repository. tc *commit-ish* --------------- -Prints the linux kernel tag which contains the supplied commit-ish +Print the oldest Linux kernel release or -rc tag that contains the supplied +*commit-ish*, or, if none do, print the branches that contain it. check-patch|cp [*commit-ish* [.. *commit-ish*]] -----------------------------------------------