Discussion:
[Buildroot] Why not perform a shallow clone?
Patrick Doyle
2016-02-24 19:30:58 UTC
Permalink
So I'm sitting here watching my buildroot make do a complete clone of
the Linux kernel, where I have told it that I want a specific sha1
commit and I started wondering...

Why not do a shallow clone?

Has it been tried? Is it a bad idea?

--wpd
Baruch Siach
2016-02-24 19:36:49 UTC
Permalink
Hi Patrick,
Post by Patrick Doyle
So I'm sitting here watching my buildroot make do a complete clone of
the Linux kernel, where I have told it that I want a specific sha1
commit and I started wondering...
Why not do a shallow clone?
Has it been tried? Is it a bad idea?
Quoting the support/download/git script:

# Try a shallow clone, since it is faster than a full clone - but that only
# works if the version is a ref (tag or branch). Before trying to do a shallow
# clone we check if ${cset} is in the list provided by git ls-remote. If not
# we fall back on a full clone.

baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- ***@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
Samuel Martin
2016-02-24 19:41:14 UTC
Permalink
Hi,
Post by Patrick Doyle
So I'm sitting here watching my buildroot make do a complete clone of
the Linux kernel, where I have told it that I want a specific sha1
commit and I started wondering...
Why not do a shallow clone?
It tries, but cannot (see
https://git.buildroot.org/buildroot/tree/support/download/git#n34)
Post by Patrick Doyle
Has it been tried? Is it a bad idea?
Yes, and no ;-)

Regards,
--
Samuel
Patrick Doyle
2016-02-24 19:50:42 UTC
Permalink
Post by Samuel Martin
Hi,
Post by Patrick Doyle
So I'm sitting here watching my buildroot make do a complete clone of
the Linux kernel, where I have told it that I want a specific sha1
commit and I started wondering...
Why not do a shallow clone?
It tries, but cannot (see
https://git.buildroot.org/buildroot/tree/support/download/git#n34)
Oh bummer...

I wonder why git-clone -b doesn't accept a sha1sum. Oh well.


So how do you folks handle pinning a revision of, for example, the
kernel? I naively assumed that I would specify
BR2_LINUX_KERNEL_CUSTOM_REPO_URL and
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION, which appears to do what I want,
but it seems wasteful to have to clone the whole Linux repo just to
get that one clone.

I suppose I could tell menuconfig that the (Atmel) kernel I am cloning
is available on github somehow and have the magic "fetch a sha1sum
from github" work. I'll go think about that for a bit.

--wpd
Patrick Doyle
2016-02-24 20:18:34 UTC
Permalink
Post by Patrick Doyle
Post by Samuel Martin
Hi,
Post by Patrick Doyle
So I'm sitting here watching my buildroot make do a complete clone of
the Linux kernel, where I have told it that I want a specific sha1
commit and I started wondering...
Why not do a shallow clone?
It tries, but cannot (see
https://git.buildroot.org/buildroot/tree/support/download/git#n34)
Oh bummer...
I wonder why git-clone -b doesn't accept a sha1sum. Oh well.
Oh, here's the answer (from
Post by Patrick Doyle
Is there a way to fetch based on SHA id's instead of named references?
No, out of security concerns; imagine you included some proprietary
source code by mistake, and undo the damage by forcing a push with a
branch that does not have the incriminating code. Usually you do not
control the garbage-collection on the server, yet you still do not want
other people to fetch "by SHA-1".

Oh well.
Post by Patrick Doyle
So how do you folks handle pinning a revision of, for example, the
kernel? I naively assumed that I would specify
BR2_LINUX_KERNEL_CUSTOM_REPO_URL and
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION, which appears to do what I want,
but it seems wasteful to have to clone the whole Linux repo just to
get that one clone.
I suppose I could tell menuconfig that the (Atmel) kernel I am cloning
is available on github somehow and have the magic "fetch a sha1sum
from github" work. I'll go think about that for a bit.
No, that doesn't seem to work either. linux.mk doesn't use $(call
github). Oh well.

I suppose I could add support for that... does that seem useful to
folks other than I?

--wpd
Arnout Vandecappelle
2016-02-24 21:25:25 UTC
Permalink
[snip]
Post by Patrick Doyle
Post by Patrick Doyle
I suppose I could tell menuconfig that the (Atmel) kernel I am cloning
is available on github somehow and have the magic "fetch a sha1sum
from github" work. I'll go think about that for a bit.
No, that doesn't seem to work either. linux.mk doesn't use $(call
github). Oh well.
$(call github) is not really needed, you can just use the actual URL in your
config: https://github.com/<project>/<repo>/archive/<version>/<version>.tar.gz


Regards,
Arnout
Post by Patrick Doyle
I suppose I could add support for that... does that seem useful to
folks other than I?
--wpd
_______________________________________________
buildroot mailing list
http://lists.busybox.net/mailman/listinfo/buildroot
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Patrick Doyle
2016-02-24 21:35:19 UTC
Permalink
Post by Arnout Vandecappelle
Post by Patrick Doyle
No, that doesn't seem to work either. linux.mk doesn't use $(call
github). Oh well.
$(call github) is not really needed, you can just use the actual URL in your
config: https://github.com/<project>/<repo>/archive/<version>/<version>.tar.gz
Oh, that's clever! Thank you very much!

--wpd

Continue reading on narkive:
Loading...