[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vcswatch



On 08/02/2014 05:02 PM, Raphael Hertzog wrote:
> Hi,
> 
> On Sat, 02 Aug 2014, Thomas Goirand wrote:
>> The obvious "solution" would be to always clone, instead of doing "git
>> fetch", though of course, this has a huge cost which maybe you don't
>> want to have. So I'm not sure how to fix it... Though a few ideas:
>>
>> 1- Have somewhere on the web interface, some button to ask for a full
>> re-clone of the package.
>> 2- Every now and then (every week?) do a full reclone
>> 3- If qa.debian.org can have ssh access to Alioth, then something like
>> this would do:
>> ssh git.debian.org 'cd /git/openstack/nova.git && git branch | grep \\*'
> 
> There's no need for this.
> 
> $ git ls-remote https://alioth.debian.org/anonscm/git/openstack/ceilometer.git|grep HEAD
> 
> This will give you the commit corresponding to the default branch. You can
> then just checkout that commit.

Oh, thanks a lot, I've been searching the net for this for a long long
time today!

FYI, in shell scripting, here's the full solution to print the default
branch on the remote:

HEADREF=`git ls-remote
https://alioth.debian.org/anonscm/git/openstack/ceilometer.git | grep
HEAD | awk '{print $1}'`

git ls-remote
https://alioth.debian.org/anonscm/git/openstack/ceilometer.git | grep
${HEADREF} | grep refs/heads | awk '{print $2}' | sed 's#refs/heads/##'

Is there something quicker than 2 "git ls-remote" calls?

Christoph, do you think you could add this check in vcswatch? I don't
think I'm good enough in perl to do it in a non-too-hackish way.

Thomas


Reply to: