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: 182826 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp5612282ile; Tue, 14 Jan 2020 06:56:11 -0800 (PST) X-Google-Smtp-Source: APXvYqx/lwrkizr/djhYLIo1OBnT4YaJnWx3QrFlkgBFtFpVhHwPHOtTrexu8Z8zoaN75ZQ7En7K X-Received: by 2002:a9d:730e:: with SMTP id e14mr16192390otk.62.1579013771389; Tue, 14 Jan 2020 06:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579013771; cv=none; d=google.com; s=arc-20160816; b=Ro+bnB6oLUlaOuL0POg/YZEezhxh6Qh7RYgIRgyZQqjP05i5tr2PKKc5agDZcHoi2Z OoVI6qOQ0NYLpogBqxPVMreTyZhGE4dFfUaDOimeWFjORPeCzeL6OmkpXrZe3JXL4QTN UU6l5tE2qgecpFRR0KmT+2vTapUDO2/hanpPJJ77eTHgzjVJ9hzT+k6e+iCrprMXZuM2 3UjCeiMhetxUi+N4wT+5J4PK0BPO24F1nDv8qpWoOHRGuSwFTXl1Ki7L7Yj8zxOUBIwq 1RipdaPXIGTfAg+1q7ciiN+32dxwq52IcLXzvmHnTt5QccpjZC9tRwkDr+p60s2RAbqi 7bHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:subject:from:cc:to :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=EHInauN/0e6xypPu5Vb6uzYDw07qcfqDqCnOPlIJ/kg=; b=WQbyFNlmiB0WxwWYzjqT1BYdWMKipz0iNe7QngN/GuMUcY+8E4XMAbhqXV2Cn7HJ92 7xsxMDke1XwB+dlgaWjY0YotpPlD9Xz+sutn06PrN/8p3vTtuXofvgEuT2ikm5BOop1V +IO9QpqehsqfTI+Q8lhwTn6Ya6a/LH3OFlwnrQbUPW0H5Bv5kpRD8PbQc6FRR12e3bnX XEhQhgTKKVL/MgmXYVgppN9Z3JfiQVXAtDyEKKIB4t7mWavEj5KdUx+0twZuheZrqvhx vtp7V6XawRb4ZAJOgcYNAahJ7nRPTlFCSwxQugWzL3DGjgJ//71nmMJi7DoXhk0QYnjJ Cbpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jDGvesc9; spf=pass (google.com: domain of gcc-patches-return-517355-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-517355-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 z11si7718240oic.176.2020.01.14.06.56.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2020 06:56:11 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-517355-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=jDGvesc9; spf=pass (google.com: domain of gcc-patches-return-517355-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-517355-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:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=C3/psTLJSMzNnhcyygngPCUBwjlQQq9qlRRxqS/S/BuovSn1/f Z57B7D6LwrokvR4voDptjoMHviAmiYMzhzx3YD/Qf2s0wCU5/QqCJtIyK/aBiXRv JNzAeo9TOERZM855pxhH32aw2O5nm1HaZUt6BmpICXNhJgHJxRWPOwJqM= 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=jDGvesc9SuooZf0tixem KBmQFSKA1lSgXVO/8Gw8Hx1rMiCcydkMR+L2lCo6gIdyB7DBPh1/qmhIrkZYZgBn GXTGA7niVqou57VeYZP+8RrGTkeT+VXmHvsnhv387aNeuRjhQpm16l8L8RJx6qMp 11qaM60oxgLTuye3l4lufSw= 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