]> git.ipfire.org Git - thirdparty/gcc.git/blob - contrib/git-fetch-vendor.sh
contrib: script to setup git to pull a vendors branches
[thirdparty/gcc.git] / contrib / git-fetch-vendor.sh
1 #!/bin/sh
2
3 if [ $# != 1 ]
4 then
5 echo "Usage: $0 <vendor>"
6 exit 1
7 fi
8
9 vendor=$1
10 upstream=`git config --get "gcc-config.upstream"`
11 if [ x"$upstream" = x ]
12 then
13 echo "Config gcc-config.upstream not set, run contrib/gcc-git-customization"
14 exit 1
15 fi
16
17 echo "setting up git to fetch vendor ${vendor} to remotes/${upstream}/${vendor}"
18
19 git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/heads/*:refs/remotes/${upstream}/${vendor}/*" ":refs/remotes/${upstream}/${vendor}/"
20 git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/tags/*:refs/tags/${vendor}/*" ":refs/tags/${vendor}/"
21 git config --replace-all "remote.${upstream}.push" "+refs/heads/${vendor}/*:refs/vendors/${vendor}/heads/*" "^\+refs/heads/${vendor}/"
22 git fetch