All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/4] download/git: ensure we can checkout repos with submodule conversions
Date: Wed, 18 Apr 2018 10:04:53 +0200	[thread overview]
Message-ID: <627eaa46-0acb-9753-15a0-d805abb18164@mind.be> (raw)
In-Reply-To: <5ad6b7cbf192b_23c22af60ee98304189d9@ultri4.mail>



On 18-04-18 05:13, Ricardo Martincoski wrote:
> Hello,
> 
> Really sorry I did finished the review/tests today to send by tags.
> 
> Could you double-check the --force option for git 1.7.1? I am not sure we would
> have a workaround for this if it is not supported.

 The help of 1.7.1 says:

git submodule [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--reference
<repository>] [--merge] [--recursive] [--] [<path>...]

No force there... Checking the code, I don't see any handling of -f or --force.

> Also a question and some typos.
> 
> On Tue, Apr 17, 2018 at 01:48 PM, Yann E. MORIN wrote:
[snip]
>> +# files after the checkout.
>> +find . -type f -name .git -exec rm {} +
> 
> In the unlikely case some user tries to abuse the git cache by first populating
> it using the 'git multiple working trees' feature the main
> dl/<package>/git/.git would be a file too. After this command all git commands
> will fail.
> But... well... that is expected! The user should not mess with the git cache,
> it is there to be used solely by buildroot.
> So we are good IMO.

 +1

 That said, IMO it would be better if the git cache were a bare repo, and that
we did the checkout outside of the repo. But I don't think that works well with
submodules. Submodules are annoying...

> 
>> +
>> +# Restore repository to the new, clean-checkout state.
>> +_git clean -ffdx
>> +_git checkout -- .
> 
> So it is needed to checkout the .git files again? Or did I miss something?

 I'm missing the point as well. Clearly needs a comment :-)

> 
> Long time since I developed using submodules, so I now forgot some catches.
> Anyway I will play with those commands tomorrow to try to understand.
> 
> [snip]
>> -    _git submodule update --init --recursive
>> +    _git submodule update --init --recursive --force
> 
> It seems --force does not exist on git 1.7.1.
> It is still possible I did something wrong when creating the docker image.
> https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/63519024

 No, it doesn't exist.

 Note that git 1.7.1 also doesn't have the .git files in the submodules; the
submodules have .git directories, i.e. they're indistinguishable from normal
repos. I think that that is not a problem for this patch, since I think git
1.7.1 *will* kill .git directories when doing git clean --ffdx, but I'm not
sure. Note that this implies that submodules will *not* be cached...

 I'm liking the bare repos more and more :-)

 Regards,
 Arnout

> It does work for git 1.8.3.
> https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/63525858
> 
> 
> Regards,
> Ricardo
> 

-- 
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

  reply	other threads:[~2018-04-18  8:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 16:48 [Buildroot] [PATCH 0/4] support/download: make the git backend more robust Yann E. MORIN
2018-04-17 16:48 ` [Buildroot] [PATCH 1/4] download/git: ensure we always work in the expected repository Yann E. MORIN
2018-04-19 15:47   ` Ricardo Martincoski
2018-04-19 20:38   ` Thomas Petazzoni
2018-04-17 16:48 ` [Buildroot] [PATCH 2/4] download/git: ensure we have a sane repository Yann E. MORIN
2018-04-19 15:50   ` Ricardo Martincoski
2018-04-19 19:45     ` Yann E. MORIN
2018-04-19 20:38   ` Thomas Petazzoni
2018-04-17 16:48 ` [Buildroot] [PATCH 3/4] download/git: ensure we can checkout repos with submodule conversions Yann E. MORIN
2018-04-18  3:13   ` Ricardo Martincoski
2018-04-18  8:04     ` Arnout Vandecappelle [this message]
2018-04-19  0:59       ` Ricardo Martincoski
2018-04-19 19:59       ` Yann E. MORIN
2018-04-19 23:30         ` Arnout Vandecappelle
2018-04-20  9:25           ` Yann E. MORIN
2018-04-17 16:48 ` [Buildroot] [PATCH 4/4] download/git: always do full-clone Yann E. MORIN
2018-04-18  3:18   ` Ricardo Martincoski
2018-04-18  8:40 ` [Buildroot] [PATCH 0/4] support/download: make the git backend more robust Thomas Petazzoni
2018-04-18  8:52   ` Thomas Petazzoni
2018-04-18 13:28     ` Ricardo Martincoski
2018-04-18 14:43       ` Thomas Petazzoni
2018-04-18 21:35         ` Ricardo Martincoski

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=627eaa46-0acb-9753-15a0-d805abb18164@mind.be \
    --to=arnout@mind.be \
    --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 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.