From patchwork Thu Oct 22 10:14:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 7464301 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 B3F089F30B for ; Thu, 22 Oct 2015 10:11:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4F19205CD for ; Thu, 22 Oct 2015 10:11:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E863F2049E for ; Thu, 22 Oct 2015 10:11:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DC096EF87; Thu, 22 Oct 2015 03:11:10 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id C9F5F6EF87 for ; Thu, 22 Oct 2015 03:11:08 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 22 Oct 2015 03:11:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,181,1444719600"; d="scan'208";a="832884011" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.67]) by fmsmga002.fm.intel.com with ESMTP; 22 Oct 2015 03:11:07 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Thu, 22 Oct 2015 13:14:38 +0300 Message-Id: <1445508878-12948-1-git-send-email-jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <20151022094409.GQ16848@phenom.ffwll.local> References: <20151022094409.GQ16848@phenom.ffwll.local> 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. v2: check for remote branches (Daniel) Signed-off-by: Jani Nikula --- dim | 12 +++++++++++- dim.rst | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dim b/dim index bd7cae828ee7..cdb48b9f8976 100755 --- a/dim +++ b/dim @@ -808,7 +808,17 @@ 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 upstream branches + git branch -r --contains $1 \ + $DIM_DRM_INTEL_REMOTE/* \ + $DIM_DRM_UPSTREAM_REMOTE/drm-next \ + $DIM_DRM_UPSTREAM_REMOTE/drm-fixes \ + origin/master | sed 's/^ *//' + fi ;; check-patch|cp) dim_checkrange $@ diff --git a/dim.rst b/dim.rst index ebbc04bc3604..d5ec5c8128fd 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 upstream branches that contain it. check-patch|cp [*commit-ish* [.. *commit-ish*]] -----------------------------------------------