aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-03-06 20:28:07 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2025-03-11 17:32:37 +0000
commit34bc3118d961c459a6bc986077826b3580e2100d (patch)
tree2d509f2e736dd9706a9f83bf1cfec2bd4be1c6e3
parent81582ca6cb692098c1bda7995aec46c6cbfbfcb3 (diff)
downloadgcc-34bc3118d961c459a6bc986077826b3580e2100d.zip
gcc-34bc3118d961c459a6bc986077826b3580e2100d.tar.gz
gcc-34bc3118d961c459a6bc986077826b3580e2100d.tar.bz2
contrib: Clean up outdated parts of gcc-git-customization.sh
It's very unlikely that anybody is still using the old remotes/$user Git repo setup and still needs this script to be able to migrate it to the remotes/users/$user structure. Simplify the script by removing those parts. This fixes an error that gets displayed in some circumstances: fatal: no such section: remote.me contrib/ChangeLog: * gcc-git-customization.sh: Delete outdated commands for migrating from very old git setups.
-rwxr-xr-xcontrib/gcc-git-customization.sh46
1 files changed, 0 insertions, 46 deletions
diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh
index 54bd35e..e58220f 100755
--- a/contrib/gcc-git-customization.sh
+++ b/contrib/gcc-git-customization.sh
@@ -156,45 +156,7 @@ if [ "x$dohook" = xyes ]; then
fi
fi
-# Scan the existing settings to see if there are any we need to rewrite.
-vendors=$(git config --get-all "remote.${upstream}.fetch" "refs/vendors/" | sed 's:.*refs/vendors/\([^/][^/]*\)/.*:\1:' | sort | uniq)
url=$(git config --get "remote.${upstream}.url")
-pushurl=$(git config --get "remote.${upstream}.pushurl")
-for v in $vendors
-do
- echo "Migrating vendor \"$v\" to new remote \"vendors/$v\""
- git config --unset-all "remote.${upstream}.fetch" "refs/vendors/$v/"
- git config --unset-all "remote.${upstream}.push" "refs/vendors/$v/"
- git config "remote.vendors/${v}.url" "${url}"
- if [ "x$pushurl" != "x" ]
- then
- git config "remote.vendors/${v}.pushurl" "${pushurl}"
- fi
- git config --add "remote.vendors/${v}.fetch" "+refs/vendors/$v/heads/*:refs/remotes/vendors/${v}/*"
- git config --add "remote.vendors/${v}.fetch" "+refs/vendors/$v/tags/*:refs/tags/vendors/${v}/*"
-done
-
-# Convert the remote 'pfx' to users/pfx to avoid problems with ambiguous refs
-# on user branches
-old_remote=$(git config --get "remote.${old_pfx}.url")
-if [ -n "${old_remote}" ]
-then
- echo "Migrating remote \"${old_pfx}\" to new remote \"users/${new_pfx}\""
- # Create a dummy fetch rule that will cause the subsequent prune to remove the old remote refs.
- git config --replace-all "remote.${old_pfx}.fetch" "+refs/empty/*:refs/remotes/${old_pfx}/*"
- # Remove any remotes
- git remote prune ${old_pfx}
- git config --remove-section "remote.${old_pfx}"
- for br in $(git branch --list "${old_pfx}/*")
- do
- old_remote=$(git config --get "branch.${br}.remote")
- if [ "${old_remote}" = "${old_pfx}" ]
- then
- git config "branch.${br}.remote" "users/${new_pfx}"
- fi
- done
-fi
-
echo "Setting up tracking for personal namespace $remote_id in remotes/users/${new_pfx}"
git config "remote.users/${new_pfx}.url" "${url}"
if [ "x$pushurl" != "x" ]
@@ -205,12 +167,4 @@ git config --replace-all "remote.users/${new_pfx}.fetch" "+refs/users/${remote_i
git config --replace-all "remote.users/${new_pfx}.fetch" "+refs/users/${remote_id}/tags/*:refs/tags/users/${new_pfx}/*" "refs/users/${remote_id}/tags/"
git config --replace-all "remote.users/${new_pfx}.push" "refs/heads/${new_pfx}/*:refs/users/${remote_id}/heads/*" "refs/users/${remote_id}"
-if [ "$old_pfx" != "$new_pfx" -a "$old_pfx" != "${upstream}" ]
-then
- git config --remove-section "remote.${old_pfx}"
-fi
-
-git config --unset-all "remote.${upstream}.fetch" "refs/users/${remote_id}/"
-git config --unset-all "remote.${upstream}.push" "refs/users/${remote_id}/"
-
git fetch "users/${new_pfx}"