From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH] raisin: Some git-checkout improvements Date: Wed, 22 Apr 2015 15:43:18 +0100 Message-ID: <5537B386.9010105@eu.citrix.com> References: <1429636614-22674-1-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Stefano Stabellini , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 04/22/2015 03:11 PM, Stefano Stabellini wrote: > On Tue, 21 Apr 2015, George Dunlap wrote: >> 1. Switch local variables to lower-case and declare them local. > > This is good. > > >> 2. Cloning git trees from remote repos is often a very long operation. >> Allow the user to specify a faster git cache as a prefix. >> >> 3. At the moment you can either check out a specific changeset or >> "master", but you can't check out a different branch, because git >> doesn't always look in origin/ for the branch. If the initial git >> checkout $tag fails, try checking out origin/$tag before giving up. > > I am in two minds about this, because it is still possible for the user > to simply: > > LIBVIRT_REVISION="origin/blah" Then we should have all the revisions point to "origin/master" for consistency. In any case, it requires the user to know the default remote repository name. >> Signed-off-by: George Dunlap >> --- >> CC: Stefano Stabellini >> --- >> defconfig | 3 +++ >> lib/git-checkout.sh | 33 ++++++++++++++++++++------------- >> 2 files changed, 23 insertions(+), 13 deletions(-) >> >> diff --git a/defconfig b/defconfig >> index d3ef283..38c7455 100644 >> --- a/defconfig >> +++ b/defconfig >> @@ -35,3 +35,6 @@ QEMU_TRADITIONAL_REVISION="master" >> SEABIOS_REVISION="master" >> GRUB_REVISION="master" >> LIBVIRT_REVISION="master" >> + >> +# Git prefix. Use this if you have a git caching proxy. >> +#GIT_PREFIX="" > > Are you aware that you can simply specify a directory in the URL > variable? I wasn't thinking of a local directory; I was thinking of the git proxy running locally on drall; e.g.: git://drall.uk.xensource.com:9419/git://xenbits.xen.org/xen.git contacts a git proxy server running on drall, port 9419. If the proxy server doesn't already have that repo, it will clone it; otherwise it will just do a fetch. Then it feeds you the info locally, which for a clone is typically a *lot* faster than cloning remotely. I think Anthony has a git proxy running on his workstation too. I was thinking of suggesting the name of a local caching proxy people might wish to set up here; but ATM I'm just using the one that someone else has already set up; I don't even know the name of either of the ones I mentioned above. :-) > Also wouldn't it be possible to achieve the same goal with the GIT > environmental variable? A brief scan of the git man page, combined with a brief survey of Google, didn't turn up anything... >> - cd $DIR-remote.tmp >> + cd $dir-remote.tmp >> $GIT branch -D dummy >/dev/null 2>&1 ||: >> - $GIT checkout -b dummy $TAG >> + $GIT checkout -b dummy $tag \ >> + || $GIT checkout -b dummy origin/$tag > > XXX Is this actually a comment, or just a placeholder of some sort? :-) -George