From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 16:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------EF10B049563C2DF1FF0AC26D" X-SW-Source: 2020-01/txt/msg00800.txt.bz2 This is a multi-part message in MIME format. --------------EF10B049563C2DF1FF0AC26D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 927 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. --------------EF10B049563C2DF1FF0AC26D Content-Type: text/x-patch; name="custom.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="custom.patch" Content-length: 2411 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 --------------EF10B049563C2DF1FF0AC26D--