All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/download/git: Prioritize remote archive
@ 2016-08-17 19:10 Benjamin Kamath
  2016-08-17 20:39 ` Thomas Petazzoni
  2016-08-17 21:03 ` Yann E. MORIN
  0 siblings, 2 replies; 10+ messages in thread
From: Benjamin Kamath @ 2016-08-17 19:10 UTC (permalink / raw)
  To: buildroot

Attempt to do a remote archive since it shortcuts us past a few steps when
available. Additionally. if the git server has uploadArchive.allowUnreachable
set to true, then this method can also work on arbitrary sha1s, offering a huge
speed advantage over a full clone.

Signed-off-by: Benjamin Kamath <kamath.ben@gmail.com>
---
 support/download/git | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/support/download/git b/support/download/git
index 416cd1b..043a6de 100755
--- a/support/download/git
+++ b/support/download/git
@@ -36,6 +36,15 @@ _git() {
     eval ${GIT} "${@}"
 }
 
+# Try a remote archive, since it is as fast as a shallow clone and can give us
+# an archive directly. Also, if uploadArchive.allowUnreachable is set to true
+# on the remote, this will also work for arbitrary sha1s, and will offer a
+# considerable speedup over a full clone.
+printf "Doing remote archive\n"
+if _git archive --format=tar.gz --prefix=${basename}/ --remote=${repo} -o ${output} ${cset} 2>&1; then
+    exit 0
+fi
+
 # 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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-22 20:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17 19:10 [Buildroot] [PATCH 1/1] support/download/git: Prioritize remote archive Benjamin Kamath
2016-08-17 20:39 ` Thomas Petazzoni
2016-08-17 21:06   ` Benjamin Kamath
2016-08-17 21:03 ` Yann E. MORIN
2016-08-17 21:13   ` Benjamin Kamath
2016-08-17 21:31     ` Yann E. MORIN
2016-08-17 21:54       ` Thomas Petazzoni
2016-08-17 22:00         ` Yann E. MORIN
2016-08-22 19:53   ` Peter Korsgaard
2016-08-22 20:55     ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.