You are not logged in.

#1 2009-08-05 21:14:39

Xiong Chiamiov
Member
From: central coast, california
Registered: 2008-06-18
Posts: 142
Website

xxx-git packages: use --depth option on git-clone?

While installing the (very nice) pianobar-git package today, I noticed that xxx-git pkgbuilds generally have a few lines like so:

    if [ -d $startdir/src/$_gitname ] ; then
        cd $_gitname && git pull origin
        msg "The local files are updated."
    else
        git clone $_gitroot
    fi

This is how it is in the example in the wiki.

Is it okay to use the --depth option of git-clone?  As I commented on the AUR page,

You might consider using the --depth option for git-clone, since the vast majority of the users aren't going to be needing to view past history (and I think yaourt throws away the git repository, anyways). This'll speed up the clone, especially as the repository continues to grow.

Thoughts?

EDIT: Oh yes, and from the manpage for git-clone:

--depth <depth>
    Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.

Last edited by Xiong Chiamiov (2009-08-05 21:16:36)

Offline

#2 2009-08-06 06:24:05

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: xxx-git packages: use --depth option on git-clone?

Sounds reasonable. I have some -git-packages in AUR and will test how it works. Do you have a "sane default" for the <depth>?

Offline

#3 2009-08-06 09:49:20

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: xxx-git packages: use --depth option on git-clone?

From http://git.or.cz/gitwiki/GitFaq:

How do I use git for large projects, where the repository is large, say approaching 1 TB, but a checkout is only a few hundred MB? Will every developer need 1 TB of local disk space?

In general, git is not a viable solution for the the case of a large repository with relatively small individual checkouts. However, if developers do not intend to clone, fetch, push into or push from their repositories, then use shallow clones

git clone --depth 1 <url>

Last edited by NVS (2009-08-06 09:51:06)

Offline

#4 2009-08-10 07:01:46

pnorcks
Member
Registered: 2008-02-24
Posts: 16

Re: xxx-git packages: use --depth option on git-clone?

I am using the shallow clone method for the "lilypond-git" package now, and it works quite well.

Offline

Board footer

Powered by FluxBB