5 echo "Usage: $0 [--enable-push] <vendor>"
6 echo "The following vendors are already known:"
7 git ls-remote
${upstream} "*/vendors/*" |
sed -r "s:.*/vendors/([^/]+)/.*:\1:"|
sort|
uniq
11 # Should we insert a "push" refspec to enable pushing to the vendor branch?
14 upstream
=`git config --get "gcc-config.upstream"`
15 if [ x
"$upstream" = x
]
17 echo "Config gcc-config.upstream not set, run contrib/gcc-git-customization"
23 # vendor names never start with -, so catch this in case user wrote something like --help.
35 if [ "$1" = "--enable-push" ]
48 echo "setting up git to fetch vendor ${vendor} to remotes/vendors/${vendor}"
49 url
=$
(git config
--get "remote.${upstream}.url")
50 pushurl
=$
(git config
--get "remote.${upstream}.pushurl")
51 git config
"remote.vendors/${vendor}.url" "${url}"
52 if [ "x$pushurl" != "x" ]
54 git config
"remote.vendors/${vendor}.pushurl" "${pushurl}"
56 git config
--replace-all "remote.vendors/${vendor}.fetch" "+refs/vendors/${vendor}/heads/*:refs/remotes/vendors/${vendor}/*" "refs/vendors/${vendor}/heads"
57 git config
--replace-all "remote.vendors/${vendor}.fetch" "+refs/vendors/${vendor}/tags/*:refs/tags/vendors/${vendor}/*" "refs/vendors/${vendor}/tags"
58 if [ "$enable_push" = "yes" ]
60 echo "Warning: take care when pushing that you only push the changes you intend."
61 echo "E.g. use \"git push vendors/${vendor} HEAD\" to push the current branch"
62 git config
--replace-all "remote.vendors/${vendor}.push" "refs/heads/${vendor}/*:refs/vendors/${vendor}/heads/*"
64 git config
--unset-all "remote.vendors/${vendor}.push"
66 git fetch vendors
/${vendor}