All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Martincoski <ricardo.martincoski@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/4] download/git: ensure we always work in the expected repository
Date: Thu, 19 Apr 2018 12:47:15 -0300	[thread overview]
Message-ID: <5ad8ba0337d9a_7cd62ad9dda4536c17646@ultri4.mail> (raw)
In-Reply-To: e9b0b62a20acfcd0641cbfee758982245a19b8fa.1523983687.git.yann.morin.1998@free.fr

Hello,

On Tue, Apr 17, 2018 at 01:48 PM, Yann E. MORIN wrote:

> git always look directories up until it finds a repository. In case
> the git cache is broken, it may no longer be identified as a repository,
> and git will look higher in the directories until it finds one.
> 
> In the default conditions, this would be Buildroot's own git tree
> (because DL_DIR is a subdir of Buildroot), but in some situations may
> very well be any repository the user has Buildroot in, like a
> br2-external tree...
> 
> So, we force git to use our git cache and never look elsewhere, as
> Suggested by Ricardo.
> 
> Use GIT_DIR, as it has been there for ages now, while --git-dir was
> only introduced later (even if most distros ship an later version),
> as suggested by Arnout.
> 
> Also fix the one call to git that was not using the wrapper.
> 
> Reported-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Acked-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
[download script bails out for a completely broken git cache, avoiding changes
 to the buildroot repo when the broken git cache is in a subdir (the default)]
Tested-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>


Tests performed:

I choose dt-utils as its version is a tag, so it does not trigger the problem
with git<1.9.0 fixed by patch 4.

1) Create an empty dir in the place of git cache and download:
 Using current master 56823d6:
  git 1.7.1: [process hungs and the buildroot repo had its origin url changed]
  git 1.8.3 and 2.11.0: [the buildroot repo had its origin url changed and also
                   the commit from dt-utils is check out in the buildroot repo]
 Current master + this patch:
  git 1.7.1 and 1.8.3 and 2.11.0: [download script bails out as expected,
                                   falling back to backup site]
2) Download with no initial git cache
 Current master + this patch:
  git 1.7.1: [works fine, fetch all refs]
  git 1.8.3 and 2.11.0: [works fine, shallow fetch]

Commands used and outputs:
https://gist.github.com/ricardo-martincoski/ea341b69a4ebeadf38e4ab02ba33adf8


Regards,
Ricardo

  reply	other threads:[~2018-04-19 15:47 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 [this message]
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
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=5ad8ba0337d9a_7cd62ad9dda4536c17646@ultri4.mail \
    --to=ricardo.martincoski@gmail.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 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.