contrib: New remotes structure for vendor and personal refs
Richard Earnshaw (lists)
Richard.Earnshaw@arm.com
Thu Jan 16 17:35:00 GMT 2020
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 vendor-<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 vendor-<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).
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.
* gcc-git-customization.sh: New personal and vendor layout.
Convert any existing fetch/push rules to new layout.
* git-fetch-vendor.sh: New vendor layout.
I'll wait a bit before pushing this, just in case someone spots an issue.
R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: custom3.patch
Type: text/x-patch
Size: 5420 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20200116/c04b2aa3/attachment.bin>
More information about the Gcc-patches
mailing list