aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2020-01-15 11:30:07 +0000
committerRichard Earnshaw <rearnsha@arm.com>2020-01-15 11:31:29 +0000
commite61074228d1fb3eb828f5c15381b5761d6362004 (patch)
treea2091473ec89f64291dccba4fb6c45836769bf88
parent8817bd75802d3ae47c54ec4fe99103308353d4ed (diff)
downloadgcc-e61074228d1fb3eb828f5c15381b5761d6362004.zip
gcc-e61074228d1fb3eb828f5c15381b5761d6362004.tar.gz
gcc-e61074228d1fb3eb828f5c15381b5761d6362004.tar.bz2
contrib: Don't add push rules for personal and vendor spaces.
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 <server> <branch>". 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. * 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.
-rw-r--r--contrib/ChangeLog7
-rwxr-xr-xcontrib/gcc-git-customization.sh19
-rwxr-xr-xcontrib/git-fetch-vendor.sh2
3 files changed, 24 insertions, 4 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 7995644..f224c20 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-15 Richard Earnshaw <rearnsha@arm.com>
+
+ * 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.
+
2010-01-13 Richard Earnshaw <rearnsha@arm.com>
Revert:
diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh
index 3b9d79d..dae2c35 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 5e1b1f0..d2d3ed5 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