From patchwork Tue Jan 21 13:29:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 182906 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3856268ile; Tue, 21 Jan 2020 05:29:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxz+K8f33cAaNlPSkb5nmISjdQsCcSBqD3+Nv5y2U/bPODjtnQ4+PyILV+PY3av9v5chMa5 X-Received: by 2002:aca:4dd6:: with SMTP id a205mr2953050oib.43.1579613394740; Tue, 21 Jan 2020 05:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579613394; cv=none; d=google.com; s=arc-20160816; b=OqQalMnfZRSwH3KKJwva4SpNEsm5zzDQqPFgb6Ni9KkB8fVF1xda8u403cGKFDrS8E MTIP49gj8cEuWnhq6RSAeIMfNTpQFC8RDzbGPXqswSTzTGGJG1StVx7Z0agzfY7FDAfq eWNHHBb8Mw6Fcjyx5oVJCPYOb21Kgu1G/Bn2LXujxGFRltMPrYgbvka1hTBPlVnpIYNP sd0gtMg0M5XO1cH9QPko9esMYXAk6NCW0dbnGNd378OSvXZ9TqcjeUvPkHya760N22GC w+gMBBBJSKqDurcLW4k+2X/hm0mLKKY+/Ti9TRuPDtogK+L2yeFDl9bp0h5DU1O7w2yX IzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:delivered-to:sender:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=p+4A1vh63ZN1cmLuTtjOK+zH3Ztb57L8xDAi7bnyrG4=; b=KEuvTPYZjbRPX5Myfg4RLjPrQRx7L+YwGyYSoBayITdvX6JmuhmxTOYd4olY8hL/Za nOyyrf0PngCmvjoka/whWOOpFG/nHofuTTqGsFCQ/EiSHVcENyPhq7iO367+9uLOXtfg a1WiHi8IKoT9WUwC6prH4BMlWnn7nfso3lP0PlnolhOd+C7BcA65FtxfHfEPZGZo2+5z kJBlmm9jqo2d3PFUIkuYZLnI4OIRNnfw0/5S/LfnUehqvCx4XYreExW9++juuy5UfzKG C9VdIzTeY6E4IYuS8KTgxYWXTPdhVlhAa6pJUicafUPwBA4J+AdoYAG3mgusX2NFwt6R NLxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lXrjJOGe; spf=pass (google.com: domain of gcc-patches-return-517882-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-517882-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s5si19115895oic.116.2020.01.21.05.29.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jan 2020 05:29:54 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-517882-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lXrjJOGe; spf=pass (google.com: domain of gcc-patches-return-517882-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-517882-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=bXfHGjxjpDcxpdDr3 0JAeHrYebwEa6ypTaUDRf7dx5FCfx37StEjujzduXRZjFg6JbpNxfQXIxHaDUfwc 6tBqb4rKvmzBdtsb3wJZRKbHbP5ayPDxubNnqIvZgdOeaD+dwFsnf6j5Ng89amSD h2ITb/55FwdWn3ZFaw6y8tQ9Nk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=krTRbarPIbp5DsL4fGZKmMW Zfdk=; b=lXrjJOGeHKw0dyKNgPT2cJzZ4cqv4SY1ZpOC9pwI+1a4lLHg/8d23Pc j0BkoU8GSOw4Zux9CvU9tOQWNakKi36Uq7Igk+Hst1/eQ5ud6s1cP8ym3QzF6vM6 VlFiuMHRz/GVF2G6+y9+Kpt12ztPixVCreMQClF+8NFE43lagjV4= Received: (qmail 3590 invoked by alias); 21 Jan 2020 13:29:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 3574 invoked by uid 89); 21 Jan 2020 13:29:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Doing, H*MI:sk:fc048ac, H*i:sk:fc048ac, H*f:sk:fc048ac X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 13:29:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 25AF830E; Tue, 21 Jan 2020 05:29:31 -0800 (PST) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.78.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A9FEE3F52E; Tue, 21 Jan 2020 05:29:30 -0800 (PST) Subject: [patch] contrib: script to create a new vendor branch From: "Richard Earnshaw (lists)" To: Hans-Peter Nilsson Cc: gcc-patches@gcc.gnu.org References: <202001210147.00L1lvmL021141@ignucius.se.axis.com> Message-ID: <59281770-ec14-177e-b509-a53c86a4b7b7@arm.com> Date: Tue, 21 Jan 2020 13:29:29 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: This script is intended to create a new vendor branch. Doing so is not completely obvious if you are not familiar with the upstream structure, so this takes the pain out of getting it right. It doesn't check out the branch locally, but does set everything up so that, if you have push enabled for your vendor branches, then git push vendors/ will work as expected. Run the script as contrib/git-add-vendor-branch.sh / the space must have previously been set up in the way git-fetch-vendor.sh expects. * git-add-vendor-bransh.sh: New file. diff --git a/contrib/git-add-vendor-branch.sh b/contrib/git-add-vendor-branch.sh new file mode 100755 index 00000000000..04d39ed6b63 --- /dev/null +++ b/contrib/git-add-vendor-branch.sh @@ -0,0 +1,43 @@ +#! /bin/sh -xve + +# Create a new upstream vendor branch. + +# Usage: +# contrib/git-add-vendor-branch.sh / + +usage () +{ + echo "Usage:" + echo " $0 / " + echo + echo " must have already been set up using contrib/git-fetch-vendor.sh" + exit 1 +} + +if [ $# != 2 ] +then + usage +fi + +vendor=$(echo "$1" | sed -r "s:([^/]*)/.*$:\1:") +branch=$(echo "$1" | sed -r "s:[^/]*/(.*)$:\1:") +start=$2 + +if [ -z "$vendor" -o -z "$branch" ] +then + usage +fi + +# Check that we know about the vendor +url=$(git config --get "remote.vendors/${vendor}.url"||true) +if [ -z "$url" ] +then + echo "Cannot locate remote data for vendor ${vendor}. Have you set it up?" + exit 1 +fi + +git branch --no-track ${vendor}/${branch} ${start} +git push vendors/${vendor} ${vendor}/${branch}:refs/vendors/${vendor}/heads/${branch} +git fetch -q vendors/${vendor} +git branch --set-upstream-to=remotes/vendors/${vendor}/${branch} ${vendor}/$branch +echo "Now ready to check out ${vendor}/${branch}"