From: Richard Earnshaw Date: Mon, 13 Jan 2020 18:20:13 +0000 (+0000) Subject: contrib: Add in the default push rule which was overridden X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b60563a8bf18b5a49431b5913f32f5c5ff8319d9;p=gcc.git contrib: Add in the default push rule which was overridden When we add a push rule, the default rule gets removed, so add that in explicitly. This needs to come last since otherwise it would match the custom redirecting rules we have for personal and vendor sub-spaces. I also noticed that the push rule for the vendor subspace still had a force push default. We don't want that so remove it. * gcc-git-customization.sh: Add back the default rule that is lost by adding a custom push rule. * git-fetch-vendor.sh: Likewise, also remove '+' from push specs. --- diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 0a525843a32..32ed283e08e 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,9 @@ +2010-01-13 Richard Earnshaw + + * gcc-git-customization.sh: Add back the default rule that + is lost by adding a custom push rule. + * git-fetch-vendor.sh: Likewise, also remove '+' from push specs. + 2010-01-13 Richard Earnshaw * contrib/git-fetch-vendor.sh: New file. diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh index 3b9d79d3d38..6665bddeb48 100755 --- a/contrib/gcc-git-customization.sh +++ b/contrib/gcc-git-customization.sh @@ -68,7 +68,11 @@ echo "(local branches starting / can be pushed directly to your" ask "personal area on the gcc server)" $old_pfx new_pfx git config "gcc-config.userpfx" "$new_pfx" +# This entry needs to come last, so unset it now, then reset it after the updates. +git config --unset "remote.${upstream}.push" "refs/heads/\\*:refs/heads/\\*" 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}/" +# Re-add the line deleted above. +git config --add "remote.${upstream}.push" "refs/heads/*:refs/heads/*" diff --git a/contrib/git-fetch-vendor.sh b/contrib/git-fetch-vendor.sh index 5e1b1f0a854..abb844dbc6a 100755 --- a/contrib/git-fetch-vendor.sh +++ b/contrib/git-fetch-vendor.sh @@ -14,9 +14,13 @@ then exit 1 fi -echo "setting up git to fetch vendor ${vendor} to remotes/${upstream}/${vendor}" +# This entry needs to come last, so unset it now, then reset it after the updates. +git config --unset "remote.${upstream}.push" "refs/heads/\\*:refs/heads/\\*" -git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/heads/*:refs/remotes/${upstream}/${vendor}/*" ":refs/remotes/${upstream}/${vendor}/" +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 config --replace-all "remote.${upstream}.push" "refs/heads/${vendor}/*:refs/vendors/${vendor}/heads/*" "^\+?refs/heads/${vendor}/" +# Re-add the line deleted above. +git config --add "remote.${upstream}.push" "refs/heads/*:refs/heads/*" git fetch