3 # Create a new upstream user branch.
6 # contrib/git-add-user-branch.sh [<personal-prefix>/]<branch-name> <base>
11 echo " $0 [<personal-prefix>/]<branch-name> <start-point>"
13 echo "personal space must already have been set up using"
14 echo "contrib/gcc-git-customization.sh"
23 userpfx
=$
(git config
--get "gcc-config.userpfx")
24 user
=$
(git config
--get "gcc-config.user")
26 if [ -z "$userpfx" -o -z "$user" ]
31 branch
=$
(echo "$1" |
sed -r "s:(${userpfx}/)?(.*)$:\2:")
34 # Sanity check the new branch argument. If there is no '/', then the
35 # vendor will be the same as the entire first argument.
41 git push users
/${userpfx} ${start}:refs/users/${user}/heads/${branch}
42 git fetch
-q users
/${userpfx}
43 git branch
${userpfx}/${branch} remotes/users/${userpfx}/${branch}
44 echo "You are now ready to check out ${userpfx}/${branch}"
45 echo "To push the branch upstream use:"
46 echo " git push users/${userpfx} ${userpfx}/${branch}"