From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/4 v3] support/download/git: do not use git archive, handle it manually
Date: Sat, 02 Jul 2016 19:08:04 +0200 [thread overview]
Message-ID: <878txk55or.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <dabe52d4bc6a665abc37b40cfd2585ba759d0e45.1467363623.git.yann.morin.1998@free.fr> (Yann E. MORIN's message of "Fri, 1 Jul 2016 11:01:17 +0200")
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> We currently use git-archive to generate the tarball. This is all handy
> and dandy, but git-archive does not support submodules. In the follow-up
> patch, we're going to handle submodules, so we would not be able to use
> git-archive.
> Instead, we manually generate the archive:
> - extract the tree to the requested cset,
> - get the date of the commit to store in the archive,
> - store only numeric owners,
> - store owner and group as 0 (zero, although any arbitrary value would
> have been fine, as long as it's a constant),
> - sort the files to store in the archive.
> We also get rid of the .git directory, because there is no reason to
> keep it in the context of Buildroot. Some people would love to keep it
> so as to speed up later downloads when updating a package, but that is
> not really doable. For example:
> - use current Buildroot
> - it would need foo-12345, so do a clone and keep the .git in the
> generated tarball
> - update Buildroot
> - it would need foo-98765
> For that second clone, how could we know we would have to first extract
> foo-12345 ? So, the .git in the archive is pretty much useless for
> Buildroot.
I've wondered if it wouldn't have been simpler to keep git archive and
then just append the git-archive output of the individual submodules
(like we do for the generated documentation in make release) with git
submodule foreach, E.G:
https://ttboj.wordpress.com/2015/07/23/git-archive-with-submodules-and-tar-magic/
Something like:
git archive --prefix=foo/ ... > $TAR
git submodule foreach --recursive \
'git archive --prefix=foo/$path/ $sha1 > $TAR.tmp && tar Af $TAR $TAR.tmp'
rm $TAR.tmp
But we can do that later if needed.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2016-07-02 17:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-01 9:01 [Buildroot] [PATCH 0/4 v3] core/download: add support for git sub-modules (branch yem/git) Yann E. MORIN
2016-07-01 9:01 ` [Buildroot] [PATCH 1/4 v3] support/download/git: do not use bare clones Yann E. MORIN
2016-07-02 16:42 ` Peter Korsgaard
2016-07-01 9:01 ` [Buildroot] [PATCH 2/4 v3] support/download/git: do not use git archive, handle it manually Yann E. MORIN
2016-07-02 17:08 ` Peter Korsgaard [this message]
2016-07-06 1:04 ` Ben Boeckel
2016-07-01 9:01 ` [Buildroot] [PATCH 3/4 v3] support/download/git: add support for submodules Yann E. MORIN
2016-07-02 17:09 ` Peter Korsgaard
2016-07-01 9:01 ` [Buildroot] [PATCH 4/4 v3] core/pkg-infra: download git submodules if the package wants them Yann E. MORIN
2016-07-02 17:11 ` Peter Korsgaard
2016-07-02 23:40 ` Yann E. MORIN
2016-07-02 23:55 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878txk55or.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox