diff mbox series

contrib: script to setup git to pull a vendors branches

Message ID db68fa92-54ac-d69e-2577-f3c78c963da0@arm.com
State New
Headers show
Series contrib: script to setup git to pull a vendors branches | expand

Commit Message

Richard Earnshaw (lists) Jan. 10, 2020, 3:04 p.m. UTC
This simple script is intended to setup a new git configuration to pull 
the branches and tags for a specific vendor.  This should simplify some 
of the steps needed for working with a vendor's branches.

* git-fetch-vendor.sh: New file.

R.

Comments

Richard Earnshaw (lists) Jan. 13, 2020, 4:15 p.m. UTC | #1
On 10/01/2020 15:04, Richard Earnshaw (lists) wrote:
> This simple script is intended to setup a new git configuration to pull
> the branches and tags for a specific vendor.  This should simplify some
> of the steps needed for working with a vendor's branches.
> 
> * git-fetch-vendor.sh: New file.
> 

I've now checked this in.

R.
diff mbox series

Patch

diff --git a/contrib/git-fetch-vendor.sh b/contrib/git-fetch-vendor.sh
new file mode 100755
index 00000000000..5e1b1f0a854
--- /dev/null
+++ b/contrib/git-fetch-vendor.sh
@@ -0,0 +1,22 @@ 
+#!/bin/sh
+
+if [ $# != 1 ]
+then
+    echo "Usage: $0 <vendor>"
+    exit 1
+fi
+
+vendor=$1
+upstream=`git config --get "gcc-config.upstream"`
+if [ x"$upstream" = x ]
+then
+    echo "Config gcc-config.upstream not set, run contrib/gcc-git-customization"
+    exit 1
+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