Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: John Keeping <john@metanate.com>
To: buildroot@buildroot.org
Cc: John Keeping <john@metanate.com>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>,
	Vincent Fazio <vfazio@xes-inc.com>
Subject: [Buildroot] [PATCH] download/git: fix LFS support
Date: Thu,  6 Jan 2022 15:19:42 +0000	[thread overview]
Message-ID: <20220106151942.1506534-1-john@metanate.com> (raw)

The original patch for commit cff428fe31 ("download/git: support Git
LFS") included a call to "git lfs install" but this was a problem as it
could modify ~/.gitconfig outside the dl/ tree.  When this was
updated it was thought that the modification to gitconfig was
unnecessary because the LFS fetch and checkout steps are performed
manually.

Unfortunately, this is not correct and the LFS checkout fails with:

	Cannot checkout LFS objects, Git LFS is not installed.

Add the call to "git lfs install", with the --local option so that only
the repository's .git/config is modified and not the user's global
~/.gitconfig.

This is also required for submodules as the parent repository's config
is not inherited.

Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Vincent Fazio <vfazio@xes-inc.com>
Signed-off-by: John Keeping <john@metanate.com>
---
 support/download/git | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/support/download/git b/support/download/git
index 41c3160099..1a1c315f73 100755
--- a/support/download/git
+++ b/support/download/git
@@ -209,10 +209,12 @@ fi
 
 # If there are large files then fetch them.
 if [ ${large_file} -eq 1 ]; then
+    _git lfs install --local
     _git lfs fetch
     _git lfs checkout
     # If there are also submodules, recurse into them,
     if [ ${recurse} -eq 1 ]; then
+        _git submodule foreach --recursive ${GIT} lfs install --local
         _git submodule foreach --recursive ${GIT} lfs fetch
         _git submodule foreach --recursive ${GIT} lfs checkout
     fi
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2022-01-06 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 15:19 John Keeping [this message]
2022-01-07 18:07 ` [Buildroot] [PATCH] download/git: fix LFS support Thomas Petazzoni

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=20220106151942.1506534-1-john@metanate.com \
    --to=john@metanate.com \
    --cc=buildroot@buildroot.org \
    --cc=vfazio@xes-inc.com \
    --cc=yann.morin.1998@free.fr \
    /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