Skip to contentSkip to conversation

download/git: fix LFS support

PATCH Applied John Keeping 2 participants 2 messages Jan 6, 2022 – Jan 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 download/git: fix LFS support

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 <[email protected]>
Cc Vincent Fazio <[email protected]>
---
 support/download/git | 2 ++
 1 file changed, 2 insertions(+)
support/download/git +2 -0
index 41c3160099..1a1c315f73 100755
@@ -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
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 18 lines · On Thu, 6 Jan 2022 15:19:42 +0000 John Keeping <[email protected]> wrote:

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.

Quoted 6 lines
Cc Arnout Vandecappelle <[email protected]>
Cc Vincent Fazio <[email protected]>
---
 support/download/git | 2 ++
 1 file changed, 2 insertions(+)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot