Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 944B518878 for ; Fri, 7 Aug 2015 11:08:42 +0000 (UTC) Received: (qmail 64099 invoked by uid 500); 7 Aug 2015 11:08:42 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 64061 invoked by uid 500); 7 Aug 2015 11:08:42 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 64052 invoked by uid 99); 7 Aug 2015 11:08:42 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 11:08:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 00CE3DB475 for ; Fri, 7 Aug 2015 11:08:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.689 X-Spam-Level: X-Spam-Status: No, score=0.689 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.112, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id ZYjR-6io45vT for ; Fri, 7 Aug 2015 11:08:28 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 95873260C2 for ; Fri, 7 Aug 2015 11:08:27 +0000 (UTC) Received: (qmail 63650 invoked by uid 99); 7 Aug 2015 11:08:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 11:08:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D7E3E0F79; Fri, 7 Aug 2015 11:08:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.incubator.apache.org Date: Fri, 07 Aug 2015 11:08:40 -0000 Message-Id: <5004c61af91b456cb1d385b6bffba5dd@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [15/17] incubator-ignite git commit: # ignite-1209 # ignite-1209 Signed-off-by: Yakov Zhdanov Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d9acbd1d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d9acbd1d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d9acbd1d Branch: refs/heads/ignite-843 Commit: d9acbd1da16efac59d3cc44c18c16af2db5f50f2 Parents: ebcdb4b Author: ashutak Authored: Thu Aug 6 18:21:08 2015 +0300 Committer: Yakov Zhdanov Committed: Thu Aug 6 18:29:44 2015 +0300 ---------------------------------------------------------------------- scripts/git-apply-patch.sh | 94 ------------------------------------- scripts/git-patch-functions.sh | 56 ++-------------------- 2 files changed, 4 insertions(+), 146 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9acbd1d/scripts/git-apply-patch.sh ---------------------------------------------------------------------- diff --git a/scripts/git-apply-patch.sh b/scripts/git-apply-patch.sh deleted file mode 100755 index 757cd26..0000000 --- a/scripts/git-apply-patch.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Git patch-file applier. -# -echo 'Usage: scripts/git-apply-patch.sh [-ih|--ignitehome ] [-idb|--ignitedefbranch ] [-ph|--patchhome ]' -echo "It should be called from IGNITE_HOME directory." -echo "Patch will be applied to DEFAULT_BRANCH from PATCHES_HOME." -echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set your own local properties (to rewrite settings at git-patch-prop-local.sh). " -echo - -# -# Init home and import properties and functions. -# -if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set. - then IGNITE_HOME=$PWD -fi - -. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties. -. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions. - -if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists. - then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties). -fi - -# -# Ignite task. -# -IGNITE_TASK=$1 - -# -# Read command line params. -# -while [[ $# > 1 ]] -do - key="$1" - - case $key in - -ih|--ignitehome) - IGNITE_HOME="$2" - shift - ;; - - -idb|--ignitedefbranch) - IGNITE_DEFAULT_BRANCH="$2" - shift - ;; - - -ph|--patchhome) - PATCHES_HOME="$2" - shift - ;; - *) - - echo "Unknown parameter: ${key}" - ;; - esac - shift -done - -echo "IGNITE_HOME : ${IGNITE_HOME}" -echo "Default branch : ${IGNITE_DEFAULT_BRANCH}" -echo "Ignite task : ${IGNITE_TASK}" -echo -echo "PATCHES_HOME : ${PATCHES_HOME}" -echo - -# -# Main script logic. -# - -currentAndDefaultBranchesShouldBeEqual ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} - -requireCleanWorkTree ${IGNITE_HOME} - -IGNITE_PATCH_FILE=${PATCHES_HOME}/${IGNITE_DEFAULT_BRANCH}_${IGNITE_TASK}.patch - -applyPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_PATCH_FILE} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9acbd1d/scripts/git-patch-functions.sh ---------------------------------------------------------------------- diff --git a/scripts/git-patch-functions.sh b/scripts/git-patch-functions.sh index 3cc1bb0..cade691 100644 --- a/scripts/git-patch-functions.sh +++ b/scripts/git-patch-functions.sh @@ -50,13 +50,16 @@ formatPatch () { cd ${GIT_HOME} git checkout ${DEFAULT_BRANCH} + + DEF_BRANCH_REV="$(git rev-parse --short HEAD)" + git checkout -b tmppatch # Merge to make only one commit. git merge --squash ${PATCHED_BRANCH} git commit -a -m "# ${PATCHED_BRANCH}" - PATCH_FILE=${PATCHES_HOME}'/'${DEFAULT_BRANCH}_${PATCHED_BRANCH}${PATCH_SUFFIX} + PATCH_FILE=${PATCHES_HOME}'/'${DEFAULT_BRANCH}_${DEF_BRANCH_REV}_${PATCHED_BRANCH}${PATCH_SUFFIX} git format-patch ${DEFAULT_BRANCH} --stdout > ${PATCH_FILE} echo "Patch file created." @@ -125,55 +128,4 @@ requireCleanWorkTree () { fi } -# -# Applies patch. Applies patch file created by formatPatch method. -# -# Params: -# - Git home. -# - Default branch. -# - File with patch. -# -applyPatch () { - GIT_HOME=$1 - DEFAULT_BRANCH=$2 - PATCH_FILE=$3 - - cd ${GIT_HOME} - - if [ ! -f ${PATCH_FILE} ] - then - echo $0", ERROR:" - echo "Expected patch file not found: $PATCH_FILE." - - exit 1 - fi - - echo "Patch $PATCH_FILE will be applied to $DEFAULT_BRANCH branch." - - git am ${PATCH_FILE} -} - -# -# Checks that given Default branch and Current branch are equal. -# Exit with code 1 in error case. -# -# Params: -# - Git home. -# - Default branch. -# -currentAndDefaultBranchesShouldBeEqual () { - GIT_HOME=$1 - DEFAULT_BRANCH=$2 - - cd ${GIT_HOME} - - CURRENT_BRANCH=$( determineCurrentBranch ${GIT_HOME} ) - - if [ "$CURRENT_BRANCH" != "$DEFAULT_BRANCH" ] - then - echo $0", ERROR:" - echo "You are not on an expected branch. Your current branch at $GIT_HOME is $CURRENT_BRANCH, should be $DEFAULT_BRANCH." - exit 1 - fi -}