summaryrefslogtreecommitdiff
path: root/contrib/git-fetch-vendor.sh
Commit message (Collapse)AuthorAgeFilesLines
* contrib: New remotes structure for vendor and personal refsRichard Earnshaw2020-01-201-9/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial structure for vendor and personal branches makes use of the default remote (normally origin) for the upstream repository). Unfortunately, this causes some confusion, especially for personal branches because a push will not push to the correct upstream location. This can be 'fixed' by adding a push refspec for the remote, but that has the unfortunate consequence of breaking the push.default behaviour for git push, and it becomes too easy to accidentally commit something unintended to the main parts of the repository. To work around this, this patch changes the configuration to use separate 'remotes' for these additional refs, with one remote for the personal space and another remote for each vendor's space. The personal space is called after the user's preferred branch-space prefix (default 'me'), the vendor spaces are called vendors/<vendor-name>. As far as possible, I've made the script automatically restructure any existing fetch or push lines that earlier versions of the scripts may have created - the gcc-git-customization.sh script will convert all vendor refs that it can find, so it is not necessary to re-add any vendors you've already added. You might, however, want to run git remote prune <origin> after running to clean up any stale upstream-refs that might still be in your local repo, and then git fetch vendors/<vendor> or git fetch <me> to re-populate the remotes/ structures. Also, for any branch you already have that tracks a personal or vendor branch upstream, you might need to run git config branch.<name>.remote <new-remote> so that merges and pushes go to the right place (I haven't attempted to automate this last part). For vendors, the new structure means that git checkout -b <vendor>/<branch> remotes/vendors/<vendor>/<branch> will correctly set up a remote tracking branch. Please be aware that if you have multiple personal branches set up, then git push <me> will still consider all of them for pushing. If you only want to push one branch, then either write git push <me> HEAD or git push <me> <me>/branch as appropriate. And don't forget '-n' (--dry-run) to see what would be done if this were not a dry run. Finally, now that the vendors spaces are isolated from each other and from the other spaces, I've added an option "--enable-push" to git-fetch-vendor.sh. If passed, then a "push" spec will be added for that vendor to enable pushing to the upstream. If you re-run the script for the same vendor without the option, the push spec will be removed. * gcc-git-customization.sh: Check that user-supplied remote name exists before continuting. Use a separate remotes for the personal commit area. Convert existing personal and vendor fetch rules to new layout. * git-fetch-vendor.sh: New vendor layout. Add --enable-push option.
* contrib: Don't add push rules for personal and vendor spaces.Richard Earnshaw2020-01-151-2/+0
| | | | | | | | | | | | | | | | | | | | Originally, it seemed like a good idea to add automatic 'push' rules to the git configuration, so that personal- and vendor-space commits would automatically push to the right place. Unfortunately, this changes git's behaviour and with these settings "git push" will try to push all branches in a local tree up to the corresponding location on the server (ignoring the push.default setting). The only known mitigation for this is to ALWAYS use "git push <server> <branch>". So instead, we no-longer add those rules by default and will document the options on the wiki. We don't automatically remove the push entries but do print out the command that will do so, if the user so wishes. * gcc-git-customization.sh: Explain why we want the user's upstream account name. Don't add push rules. Check if push rules have been added and suggest that they should be removed. * git-fetch-vendor.sh: Don't add push rules.
* Revert "contrib: Add in the default push rule which was overridden"Richard Earnshaw2020-01-131-7/+3
| | | | | | This reverts commit b60563a8bf18b5a49431b5913f32f5c5ff8319d9. Doesn't work as expected.
* contrib: Add in the default push rule which was overriddenRichard Earnshaw2020-01-131-3/+7
| | | | | | | | | | | | | | When we add a push rule, the default rule gets removed, so add that in explicitly. This needs to come last since otherwise it would match the custom redirecting rules we have for personal and vendor sub-spaces. I also noticed that the push rule for the vendor subspace still had a force push default. We don't want that so remove it. * gcc-git-customization.sh: Add back the default rule that is lost by adding a custom push rule. * git-fetch-vendor.sh: Likewise, also remove '+' from push specs.
* contrib: script to setup git to pull a vendors branchesRichard Earnshaw2020-01-131-0/+22
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.