[Nix-dev] [Nix-commits] [NixOS/hydra] be3748: In case of deep clone, make sure there is local br...

Nicolas Pierron nicolas.b.pierron at gmail.com
Wed Apr 25 23:08:06 CEST 2012


On Wed, Apr 25, 2012 at 12:42, Rob Vermaas <rob.vermaas at gmail.com> wrote:
> Hi,
>
>>> diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm
>>> index 3a81cb5..feecf0d 100644
>>> --- a/src/lib/Hydra/Helper/AddBuilds.pm
>>> +++ b/src/lib/Hydra/Helper/AddBuilds.pm
>>> @@ -343,6 +343,10 @@ sub fetchInputGit {
>>>         ($res, $stdout, $stderr) = captureStdoutStderr(600,
>>>             ("git", "pull", "--ff-only", "-fu", "--all"));
>>>         die "Error pulling latest change from git repo at `$uri':\n$stderr" unless $res;
>>> +        # Make sure there is a local branch
>>> +        ($res, $stdout, $stderr) = captureStdoutStderr(600,
>>> +            ("git", "checkout", "-f", $branch));
>>> +        die "Error making local branch $branch in $clonePath from git repo at `$uri':\n$stderr" unless $res;
>>
>> You should avoid checkout, in fact it would be better to have
>> bare/mirror repository for git.
>> I you want to create a local branch, use "git fetch -fu origin
>> +$branch:$branch".
>>
>> I think you can get rid of the deep clone condition here and use the
>> other branch which already have "git fetch -fu origin
>> +$branch:$branch".

The checkout might still be needed by "tg populate" which is fetching
every top-git branches and copy them to the current repository.

>
> Doesn't the deep clone need all remote branches to be fetched in stead
> of the one branch? Maybe I am just confused to what a deep clone is
> supposed to be.

I don't think so as long as we don't use "git describe --all", which
is by the way not handled by nix-prefecth-git.  Otherwise, if the git
documentation is not misleading, all tags on the path should be
fetched too and "git describe" should work.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/


More information about the nix-dev mailing list