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: 1226541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-517882-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=HRg0XLb6; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4828Xd1Zrfz9sP3 for ; Wed, 22 Jan 2020 00:29:51 +1100 (AEDT) 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=k7t38P4NipjPhRuSB K8WxLczLXSFIO9bAzjsxvCiq/4n7WWyz8iyrtFpA/e3jbgetVnmtqsN9Y9PO4NdP ITAM9uzwa775gKfSYw84XV1zyMc3pCW/yjuLpOasAWL2aFUzSsJXsHHsVrWrHjpu GkygHjo96BNwQ+3DL3b6r3jt8k= 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=HRg0XLb6rjXApjxAYvKDOaGNuIZNwW8xcGAqYzHRddnTG0IUIkj9GA8 JLEFocxYwIKAU7iq/7eeNX8QoK8Ws1vDgFfBNfBiawlmEKWLYqkk+fZBybs4yGZ+ fTIrZd4Yk6iFr7Cflsvx7aRauwsIWTTlSZUAeUJY+EjGFYPvLE0I= 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}"