Can I config some projects in a manifest to git clone with "--depth 1"?

1,763 views
Skip to first unread message

Chunlin Zhang

unread,
Nov 27, 2012, 2:20:01 AM11/27/12
to repo-d...@googlegroups.com
I think it will more fast when the git project handle with binary files only.
I search "repo help manifest" and did not find option about this.
Thanks.

Pursehouse, David

unread,
Nov 27, 2012, 2:25:39 AM11/27/12
to Chunlin Zhang, repo-d...@googlegroups.com

You can set the depth when doing repo init, but that applies to all projects.  You can’t set it only for specific projects.

 

$ repo init -u git://path/to/manifest -b branch --depth 1

Chunlin Zhang

unread,
Nov 27, 2012, 3:10:41 AM11/27/12
to Pursehouse, David, repo-d...@googlegroups.com
On Tue, Nov 27, 2012 at 3:25 PM, Pursehouse, David
<David.Pu...@sonymobile.com> wrote:
> You can set the depth when doing repo init, but that applies to all
> projects. You can’t set it only for specific projects.
>
>
>
> $ repo init -u git://path/to/manifest -b branch --depth 1
So it is impossible now to config depth only for specific projects in manifest?
My case is some git project is for binary files,I don't want to
download whole history,but for other git projects I want to download
whole history to look back or get the git log in daily build for
interoperate with gerrit and issue tracker.

Will repo add this feature in future?

Pursehouse, David

unread,
Nov 27, 2012, 5:06:28 AM11/27/12
to Chunlin Zhang, repo-d...@googlegroups.com
> So it is impossible now to config depth only for specific projects in manifest?
>

Correct.

> Will repo add this feature in future?
>

I haven't heard it mentioned before, but I'll have a go at it later this week. It would also be a useful feature for us.

Chunlin Zhang

unread,
Nov 28, 2012, 8:30:12 AM11/28/12
to Pursehouse, David, repo-d...@googlegroups.com
Thanks David for the patch: https://gerrit-review.googlesource.com/#/c/39820/
But how can I do with the error of "fatal: branch 'stable' has not
been signed" when I want to try the repo version of David?

Magnus Bäck

unread,
Nov 28, 2012, 8:45:49 AM11/28/12
to repo-d...@googlegroups.com
On Wednesday, November 28, 2012 at 08:30 EST,
Chunlin Zhang <zhangc...@gmail.com> wrote:

> Thanks David for the patch:
> https://gerrit-review.googlesource.com/#/c/39820/
> But how can I do with the error of "fatal: branch 'stable' has
> not been signed" when I want to try the repo version of David?

Run "repo init" with --no-repo-verify.

--
Magnus Bäck
ba...@google.com

Chunlin Zhang

unread,
Nov 28, 2012, 8:59:05 AM11/28/12
to Repo and Gerrit Discussion
It works!
>
> --
> Magnus Bäck
> ba...@google.com

Chunlin Zhang

unread,
Jan 17, 2014, 4:02:17 AM1/17/14
to Repo and Gerrit Discussion, David Pursehouse
David,
I found if I config clone-depth="N" in default section,it does not act as default value.
For example:
<default remote="aosp" revision="master" clone-depth="2"/>
still got full log in git.

I think it will be handy to some circumstance,for example,CI want to obtain source code with depth 1(that will be more quick),we can config clone-depth in "default" section to do this.

Thanks.

David Pursehouse

unread,
Jan 17, 2014, 4:27:05 AM1/17/14
to repo-d...@googlegroups.com
On 01/17/2014 06:02 PM, Chunlin Zhang wrote:
> David,
> I found if I config clone-depth="N" in default section,it does not act
> as default value.
> For example:
> <default remote="aosp" revision="master" clone-depth="2"/>
> still got full log in git.
>
> I think it will be handy to some circumstance,for example,CI want to
> obtain source code with depth 1(that will be more quick),we can
> config clone-depth in "default" section to do this.
>
The intention with the clone-depth attribute in the project entry was to
allow override of the value specified on repo init only for specific
projects.

If we allow specifying a default depth, this will have the effect that
all projects will always be synched with that depth, regardless of what
is specified on the command line. Is that what is desired?

In the meantime if your CI wants to always use depth 1 for all projects,
you can achieve this by using `--depth 1` when running the repo init
command.



> Thanks.
>
> On Wed, Nov 28, 2012 at 9:59 PM, Chunlin Zhang <zhangc...@gmail.com
> <mailto:zhangc...@gmail.com>> wrote:
>
> On Wed, Nov 28, 2012 at 9:45 PM, Magnus Bäck <ba...@google.com
> <mailto:ba...@google.com>> wrote:
> > On Wednesday, November 28, 2012 at 08:30 EST,
> > Chunlin Zhang <zhangc...@gmail.com
> <mailto:zhangc...@gmail.com>> wrote:
> >
> >> Thanks David for the patch:
> >> https://gerrit-review.googlesource.com/#/c/39820/
> >> But how can I do with the error of "fatal: branch 'stable' has
> >> not been signed" when I want to try the repo version of David?
> >
> > Run "repo init" with --no-repo-verify.
> It works!
> >
> > --
> > Magnus Bäck
> > ba...@google.com <mailto:ba...@google.com>
> >
> > --
> > To unsubscribe, email repo-discuss...@googlegroups.com
> <mailto:repo-discuss%2Bunsu...@googlegroups.com>
> --
> ---
> You received this message because you are subscribed to the Google
> Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to repo-discuss...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Chunlin Zhang

unread,
Jan 17, 2014, 4:42:30 AM1/17/14
to David Pursehouse, Repo and Gerrit Discussion
On Fri, Jan 17, 2014 at 5:27 PM, David Pursehouse <david.pu...@sonymobile.com> wrote:
On 01/17/2014 06:02 PM, Chunlin Zhang wrote:
David,
I found if I config clone-depth="N" in default section,it does not act
as default value.
For example:
<default remote="aosp" revision="master" clone-depth="2"/>
still got full log in git.

I think it will be handy to some circumstance,for example,CI want to
obtain source code with depth 1(that will be more quick),we can
config clone-depth in "default" section to do this.

The intention with the clone-depth attribute in the project entry was to allow override of the value specified on repo init only for specific projects.

If we allow specifying a default depth, this will have the effect that all projects will always be synched with that depth, regardless of what is specified on the command line.  Is that what is desired?

In the meantime if your CI wants to always use depth 1 for all projects, you can achieve this by using `--depth 1` when running the repo init command.
That's great!
Thanks~ 



Thanks.

On Wed, Nov 28, 2012 at 9:59 PM, Chunlin Zhang <zhangc...@gmail.com
<mailto:zhangc...@gmail.com>> wrote:

    On Wed, Nov 28, 2012 at 9:45 PM, Magnus Bäck <ba...@google.com
    <mailto:ba...@google.com>> wrote:
     > On Wednesday, November 28, 2012 at 08:30 EST,
     >      Chunlin Zhang <zhangc...@gmail.com
    <mailto:zhangc...@gmail.com>> wrote:
     >
     >> Thanks David for the patch:
     >> https://gerrit-review.googlesource.com/#/c/39820/
     >> But how can I do with the error of "fatal: branch 'stable' has
     >> not been signed" when I want to try the repo version of David?
     >
     > Run "repo init" with --no-repo-verify.
    It works!
     >
     > --
     > Magnus Bäck
     > ba...@google.com <mailto:ba...@google.com>

     >
     > --
     > To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
---
You received this message because you are subscribed to the Google
Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send

For more options, visit https://groups.google.com/groups/opt_out.

--
--- You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/tQhxV7zshFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss+unsubscribe@googlegroups.com.

Chunlin Zhang

unread,
Jan 24, 2014, 4:38:53 AM1/24/14
to David Pursehouse, Repo and Gerrit Discussion
I found an issue,if use repo init --depth, when run git log in the shallow git project repo fetch,will get err msg like this in the end of output:

error: Could not read 8d73f4f5e4d8c9f698dfdc3063ac3b41c0cf6894
fatal: Failed to traverse parents of commit 0f2939331cc60fd47872f60b65f32d84ad7e2cbe

But if I use git directly to clone with a --depth option,there is not this error if I run git log.

I see repo use "git fetch" to obtain revisions from remote,and I try with same cmd,but fail to reproduce this issue with git.
Reply all
Reply to author
Forward
0 new messages