From patchwork Mon Oct 2 18:32:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 9981143 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 811056029B for ; Mon, 2 Oct 2017 18:32:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70ECB201A4 for ; Mon, 2 Oct 2017 18:32:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6299B28811; Mon, 2 Oct 2017 18:32:56 +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.2 required=2.0 tests=BAYES_00, 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 D03E8201A4 for ; Mon, 2 Oct 2017 18:32:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 12E846E395; Mon, 2 Oct 2017 18:32:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74F7E6E395 for ; Mon, 2 Oct 2017 18:32:53 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 02 Oct 2017 11:32:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,470,1500966000"; d="scan'208";a="141850583" Received: from rdvivi-vienna.jf.intel.com ([10.7.196.88]) by orsmga002.jf.intel.com with ESMTP; 02 Oct 2017 11:32:52 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 2 Oct 2017 11:32:36 -0700 Message-Id: <20171002183236.27322-1-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.13.5 Cc: Jani Nikula , Daniel Vetter , Rodrigo Vivi Subject: [Intel-gfx] [maintainer-tools PATCH] dim: Add helpers to move fixes branches up. 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-Virus-Scanned: ClamAV using ClamSMTP One of main doubts I had when starting maintaining the fixes branches was when to move them, but also how, to-where, and when avoid moving and stay on the current one. So this scripts aims to avoid doubts and mistakes on fixes maintainance besides making all bases more clear and standardized. Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Daniel Vetter Signed-off-by: Rodrigo Vivi --- dim | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ dim.rst | 13 +++++++++++++ 2 files changed, 63 insertions(+) diff --git a/dim b/dim index fc16d114632f..8643bafcd2a5 100755 --- a/dim +++ b/dim @@ -918,6 +918,56 @@ function dim_apply_pull return $rv } +function rebase_branch +{ + local branch newbase + + branch=${1:?$usage} + shift + newbase=${1:?$usage} + shift + + assert_branch $branch + assert_repo_clean + + $DRY git rebase $newbase "$@" +} + +dim_alias_rf=rebase-fixes +function dim_rebase_fixes +{ + local tag commit + + commit=$(git rev-list --tags --max-count=1 --remotes=$DIM_DRM_INTEL) + tag=$(git describe --tags $commit) + + if [[ $tag != *"-rc"* ]]; then + echoerr "Tag $tag is not an -rc one." + return 1; + fi + + rebase_branch drm-intel-fixes $tag "$@" + + if [ $DRY ]; then + return 0; + fi + + if [ $(git rev-parse HEAD) != $commit ]; then + git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-fixes + echoerr "ERROR: fixes didn't fully propagated yet, aborting" + fi +} + +dim_alias_rnf=rebase-next-fixes +function dim_rebase_next_fixes +{ + local dim_drm_upstream_remote + + dim_drm_upstream_remote=$(url_to_remote $drm_upstream_git) + + rebase_branch drm-intel-next-fixes $dim_drm_upstream_remote/drm-next "$@" +} + function dim_backmerge { local branch upstream patch_file diff --git a/dim.rst b/dim.rst index 65e652e8bc75..a53ef8aa67e2 100644 --- a/dim.rst +++ b/dim.rst @@ -376,6 +376,19 @@ apply-pull *branch* ------------------- Reads a pull request mail from stdin and merges it into the given *branch*. +rebase-fixes +------------ +Rebases drm-intel-fixes to latest Linus tag. +This command is to be used following a Linus "-rc" tag, in order to move +drm-intel-fixes branch up. +It fails if tag is not an -rc tag. +It fails if your current fixes didn't fully propagated yet. + +rebase-fixes-next +----------------- +Rebases drm-intel-next queued into drm-next. +This command is to be used after drm-next is closed for new features. + backmerge *branch* *upstream* -----------------------------