[v2] contrib: New remotes structure for vendor and personal refs

Hans-Peter Nilsson hp@axis.com
Tue Jan 21 02:07:00 GMT 2020


> From: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
> Date: Fri, 17 Jan 2020 12:21:07 +0100

> 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.

I fail, using these instructions, trying to create a
vendor-branch named axis/cris-decc0, using git-2.11.0 from
Debian 9.

> 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.

(I did not use gcc-git-customization.sh or git-fetch-vendor.sh before
XXXXXX, so there's presumably nothing to clean up.)

I've done
$ ./contrib/gcc-git-customization.sh
and
$ ./contrib/git-fetch-vendor.sh --enable-push axis

> 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.

On master, doing

$ git checkout -b axis/cris-decc0 remotes/vendors/axis/cris-decc0
fatal: Cannot update paths and switch to branch 'axis/cris-decc0' at the same time.
Did you intend to checkout 'remotes/vendors/axis/cris-decc0' which can not be resolved as commit?

My .git/config looks like this after the gcc-descr and
gcc-undescr lines:

[diff "md"]
	xfuncname = ^\\(define.*$
[gcc-config]
	upstream = origin
	user = hp
	userpfx = me
[remote "me"]
	url = git+ssh://gcc.gnu.org/git/gcc.git
	fetch = +refs/users/hp/heads/*:refs/remotes/me/*
	fetch = +refs/users/hp/tags/*:refs/tags/me/*
	push = refs/heads/me/*:refs/users/hp/heads/*
[remote "vendors/axis"]
	url = git+ssh://gcc.gnu.org/git/gcc.git
	fetch = +refs/vendors/axis/heads/*:refs/remotes/vendors/axis/*
	fetch = +refs/vendors/axis/tags/*:refs/tags/vendors/axis/*
	push = refs/heads/axis/*:refs/vendors/axis/heads/*

Bug in script (undiscovered because e.g. everybody else uses an
existing vendor or branch) or PEBKAC?

I'm past git 101, maybe even intermediate, for some definition
thereof, but this refs-configury is way beyond my
error-correction capabilities; I can't tell typos.

I'm about to create a devel/ branch instead, as that seems way
simpler than playing hide-and-seek like this, but that will make
everyone else fetch an additional blob that may be several
kilobytes (compressed).  Probably much larger than this email. :)

brgds, H-P



More information about the Gcc-patches mailing list