[aur-general] Git sparse checkouts

Matthew Monaco dgbaley27 at 0x01b.net
Wed Dec 21 13:21:25 EST 2011

On 12/21/2011 02:02 AM, Dan Vrátil wrote:
> On Wed, 21 Dec 2011 03:37:53 +0000, Simon Stoakley
> <sausageandeggs at archlinux.us>  wrote:
>> Hi All,
>> I'm uploading a pkg for an mpris2 plugin for Kupfer. I don't want to
>> clone the whole git repo (seems wasteful and I think half the code
>> there is dead) and the only part that I'm interested in is the mpris2
>> folder. The only way I've found of checking out part of a repo in is
>> to use the sparse checkout trick.
>> The question I have is whether or not it's OK to use this in a
>> PKGBUILD or not, what say ye wise men?!
>>    PKGBUILD below for reference (depends on pkgs I haven't uploaded
>> yet if you try building)
>> Thanks
>> Simon
> Hi,
> I don't think git allows you to clone just part of a repo (unlike SVN),
> but what I
> usually do is to reduce the clone depth: git clone git://url.com/repo
> --depth 1
> The --depth switch will make git to clone only the most recent history,
> because when
> compiling, you are hardly interested in previous commits. It usually
> makes the clone
> operation significantly faster and saves a lot of bandwidth.
> Cheers,
> Dan

If the PKGBUILD is supposed to be for some specific release of this package, and 
it's only available through git, then you  need to find a mirror that allows for 
git archive (even if they only allow tarring with no compression). Because with 
git clone --depth you can only get the latest. However, if it's a traditional 
-git package then --depth should work fine.

More information about the aur-general mailing list