From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45881 invoked by alias); 21 Jan 2020 10:36:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 45809 invoked by uid 89); 21 Jan 2020 10:36:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:f8aab45, H*MI:sk:f8aab45, H*i:sk:f8aab45 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 10:36:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 586BB1FB; Tue, 21 Jan 2020 02:36:15 -0800 (PST) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.78.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCF1C3F6C4; Tue, 21 Jan 2020 02:36:14 -0800 (PST) Subject: Re: [v2] contrib: New remotes structure for vendor and personal refs From: "Richard Earnshaw (lists)" To: Hans-Peter Nilsson Cc: gcc-patches@gcc.gnu.org References: <202001210147.00L1lvmL021141@ignucius.se.axis.com> Message-ID: Date: Tue, 21 Jan 2020 11:20:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2020-01/txt/msg01309.txt.bz2 On 21/01/2020 10:26, Richard Earnshaw (lists) wrote: > On 21/01/2020 01:47, Hans-Peter Nilsson wrote: >>> From: "Richard Earnshaw (lists)" >>> 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 >>> after running to clean up any stale upstream-refs that might still be in >>> your local repo, and then >>>     git fetch vendors/ >>> or >>>     git fetch >>> 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..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 / remotes/vendors// >>> >>> 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? >> > > It's nothing to do with setting up your vendors space, but a consequence > that you can't track a remote branch that hasn't been created yet; > you'll see the same thing even for personal branches or for other new > vendor branches.  I'll need to document that. > > Initially, you'll need to create the upstream branch, something like > (but untested). > > # Set up axis vendor area > contrib/git-fetch-vendor.sh --enable-push axis > # Using master, or some other branch you want to base this on. > git checkout -b axis/cris-decc0 master > # create upstream > git push vendors/axis axis/cris-decc0:refs/vendors/axis/heads/cris-decc0 > > (In theory, you should be able to add '-u' to the above, but > unfortunately, that doesn't work.  So, after the above) > > # re-fetch the new branch > git fetch vendors/asis > git branch --set-upstream remotes/vendors/axis/cris-decc0 --set-upstream-to of course (I said it was untested:) R. > > Now things should push and pull properly. > >> 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 >> > > Hope that helps, > > R.