From patchwork Thu Jan 28 13:27:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 8150391 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 46C09BEEE5 for ; Thu, 28 Jan 2016 13:29:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75B3120364 for ; Thu, 28 Jan 2016 13:29:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 586B52034C for ; Thu, 28 Jan 2016 13:29:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA31B6E899; Thu, 28 Jan 2016 05:29:01 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D4BB6E898 for ; Thu, 28 Jan 2016 05:28:58 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 28 Jan 2016 05:28:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,358,1449561600"; d="scan'208";a="903003975" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.67]) by fmsmga002.fm.intel.com with ESMTP; 28 Jan 2016 05:28:56 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Thu, 28 Jan 2016 15:27:23 +0200 Message-Id: <25a0c2c2212547d524e307c97c8544f2f0b99dd2.1453985388.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: jani.nikula@intel.com Subject: [Intel-gfx] [maintainer-tools PATCH v2 29/33] dim: abstract dim_{create, remove}_branch 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 Signed-off-by: Jani Nikula --- dim | 100 +++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/dim b/dim index 88ee7350741d..4ff903fb3818 100755 --- a/dim +++ b/dim @@ -515,6 +515,58 @@ function dim_magic_patch done } +function dim_create_branch +{ + if [[ "x$1" = "x" ]]; then + echo "usage: $0 $subcommand branch [commit-ish]" + exit 1 + fi + branch=$1 + if [[ "x$2" = "x" ]]; then + start=HEAD + else + start=$2 + fi + + cd $DIM_PREFIX/$DIM_DRM_INTEL + + $DRY git branch $branch $start + git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$branch --set-upstream + cd $DIM_PREFIX/drm-intel-rerere + $DRY echo "nightly_branches=\"\$nightly_branches origin/$branch\"" \ + >> nightly.conf + $DRY git add nightly.conf + $DRY git commit --quiet -m "Adding $branch to -nightly" +} + +function dim_remove_branch +{ + if [[ "x$1" = "x" ]]; then + echo "usage: $0 $subcommand branch" + exit 1 + fi + branch=$1 + + cd $DIM_PREFIX/$DIM_DRM_INTEL + + if ! $DRY git branch -d $branch ; then + warn_or_fail "Can't remove $branch in working repo" + fi + + if [[ -d $DIM_PREFIX/$branch ]] ; then + rm -R $DIM_PREFIX/$branch + fi + + cd $DIM_PREFIX/drm-intel-nightly + git push $DRY_RUN origin --delete $branch + $DRY git fetch origin --prune + cd $DIM_PREFIX/drm-intel-rerere + full_branch="origin/$branch" + $DRY sed -e "/${full_branch//\//\\\/}/d" -i nightly.conf + $DRY git add nightly.conf + $DRY git commit --quiet -m "Deleted $branch and removed from -nightly" +} + function dim_cd { local path @@ -1031,54 +1083,6 @@ fi # XXX: abscract each case to a dim_ prefixed function, and turn the help|*) case # into an else branch in the above check for functions. case "$subcmd" in - create-branch) - if [[ "x$1" = "x" ]]; then - echo "usage: $0 $subcommand branch [commit-ish]" - exit 1 - fi - branch=$1 - if [[ "x$2" = "x" ]]; then - start=HEAD - else - start=$2 - fi - - cd $DIM_PREFIX/$DIM_DRM_INTEL - - $DRY git branch $branch $start - git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$branch --set-upstream - cd $DIM_PREFIX/drm-intel-rerere - $DRY echo "nightly_branches=\"\$nightly_branches origin/$branch\"" \ - >> nightly.conf - $DRY git add nightly.conf - $DRY git commit --quiet -m "Adding $branch to -nightly" - ;; - remove-branch) - if [[ "x$1" = "x" ]]; then - echo "usage: $0 $subcommand branch" - exit 1 - fi - branch=$1 - - cd $DIM_PREFIX/$DIM_DRM_INTEL - - if ! $DRY git branch -d $branch ; then - warn_or_fail "Can't remove $branch in working repo" - fi - - if [[ -d $DIM_PREFIX/$branch ]] ; then - rm -R $DIM_PREFIX/$branch - fi - - cd $DIM_PREFIX/drm-intel-nightly - git push $DRY_RUN origin --delete $branch - $DRY git fetch origin --prune - cd $DIM_PREFIX/drm-intel-rerere - full_branch="origin/$branch" - $DRY sed -e "/${full_branch//\//\\\/}/d" -i nightly.conf - $DRY git add nightly.conf - $DRY git commit --quiet -m "Deleted $branch and removed from -nightly" - ;; checker) rm drivers/gpu/drm/i915/*.o &> /dev/null || true rm drivers/gpu/drm/i915/*.ko &> /dev/null || true