From patchwork Tue Jan 14 14:55:44 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: 1222839 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-517355-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=xSXJEGIM; 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 47xtnP1JY1z9sPn for ; Wed, 15 Jan 2020 01:56:07 +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:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=fMt05N1QRzZixGI2dxBTsA9H/B2o4fc85H8QweZf9SnCqNwi8e 1iRVxUElQkeqhhEOle9FU2OZ75Bk/x2XwNSXDGiwee8J0KAwdogaaBWed54hA3Y+ G2F/UCJlYjUREWoVqJVs+ZPhbKrgAgUCI71+56uOKLH00PZEoFQRluVqY= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=XF68KyEUD3bRxBVwjcnH45YgDpE=; b=xSXJEGIMGgWJSqbF/JDW moVTSVigIoY/VRypJU74wY5dZZWJQtAIw5QYYxpkrIY8aDLSY/qEtodPKv2GkHUv MnI7Tqv4PL2t2gGbPCIFLo79t7LtfdTQEGJgskSh60vbk+8Ag8TJ1QCbo9pf/W86 e4ro6ZebM6L+1jkrLCFJvmk= Received: (qmail 113105 invoked by alias); 14 Jan 2020 14:55:58 -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 113048 invoked by uid 89); 14 Jan 2020 14:55:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Explain, gits, seemed, wishes 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, 14 Jan 2020 14:55:48 +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 213711396; Tue, 14 Jan 2020 06:55:46 -0800 (PST) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A08043F68E; Tue, 14 Jan 2020 06:55:45 -0800 (PST) To: GCC Patches Cc: Jonathan Wakely From: "Richard Earnshaw (lists)" Subject: [patch] contrib: Don't add push rules for personal and vendor spaces. Message-ID: <76a55bf3-9184-0e06-4776-25a6d514e3c3@arm.com> Date: Tue, 14 Jan 2020 14:55:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Originally, it seemed like a good idea to add automatic 'push' rules to the git configuration, so that personal- and vendor-space commits would automatically push to the right place. Unfortunately, this changes git's behaviour and with these settings "git push" will try to push all branches in a local tree up to the corresponding location on the server (ignoring the push.default setting). The only known mitigation for this is to ALWAYS use "git push ". So instead, we no-longer add those rules by default and will document the options on the wiki. We don't automatically remove the push entries but do print out the command that will do so, if the user so wishes. OK? * gcc-git-customization.sh: Explain why we want the user's upstream account name. Don't add push rules. Check if push rules have been added and suggest that they should be removed. * git-fetch-vendor.sh: Don't add push rules. diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh index 3b9d79d3d38..dae2c35bb57 100755 --- a/contrib/gcc-git-customization.sh +++ b/contrib/gcc-git-customization.sh @@ -55,7 +55,7 @@ then fi fi fi -ask "Account name on gcc.gnu.org" $remote_id remote_id +ask "Account name on gcc.gnu.org (for your personal branches area)" $remote_id remote_id git config "gcc-config.user" "$remote_id" old_pfx=`git config --get "gcc-config.userpfx"` @@ -71,4 +71,19 @@ git config "gcc-config.userpfx" "$new_pfx" echo "Setting up tracking for personal namespace $remote_id in remotes/$upstream/${new_pfx}" git config --replace-all "remote.${upstream}.fetch" "+refs/users/${remote_id}/heads/*:refs/remotes/${upstream}/${new_pfx}/*" ":refs/remotes/${upstream}/${old_pfx}/" git config --replace-all "remote.${upstream}.fetch" "+refs/users/${remote_id}/tags/*:refs/tags/${new_pfx}/*" ":refs/tags/${old_pfx}/" -git config --replace-all "remote.${upstream}.push" "refs/heads/${new_pfx}/*:refs/users/${remote_id}/heads/*" "^\+?refs/heads/${old_pfx}/" + +push_rule=`git config --get "remote.${upstream}.push"` +if [ "x$push_rule" != "x" ] +then + echo "***********************************************" + echo " Warning" + echo "***********************************************" + echo + echo "Old versions of this script used to add custom push" + echo "rules to simplify pushing to personal branches." + echo "Your configuration contains such rules, but we no-longer" + echo "recommend doing this." + echo + echo "To delete these rules run:" + echo " git config --unset-all \"remote.${upstream}.push\"" +fi diff --git a/contrib/git-fetch-vendor.sh b/contrib/git-fetch-vendor.sh index 5e1b1f0a854..d2d3ed56ad7 100755 --- a/contrib/git-fetch-vendor.sh +++ b/contrib/git-fetch-vendor.sh @@ -15,8 +15,6 @@ then fi echo "setting up git to fetch vendor ${vendor} to remotes/${upstream}/${vendor}" - git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/heads/*:refs/remotes/${upstream}/${vendor}/*" ":refs/remotes/${upstream}/${vendor}/" git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/tags/*:refs/tags/${vendor}/*" ":refs/tags/${vendor}/" -git config --replace-all "remote.${upstream}.push" "+refs/heads/${vendor}/*:refs/vendors/${vendor}/heads/*" "^\+refs/heads/${vendor}/" git fetch