crow-plugins/clone
Archived
1
0
Fork
You've already forked clone
1

Submodules don't run LFS checkout #113

Open
opened 2023年12月21日 17:43:52 +01:00 by yottapanda · 0 comments
yottapanda commented 2023年12月21日 17:43:52 +01:00 (Migrated from github.com)
Copy link

Say I have repo A and repo B. Repo A includes repo B as a submodule. Repo B has an lfs-stored png.

Using the default clone behaviour, the LFS PNG in repo B is not checked out when running a workflow on repo A.

+ git init -b main
Initialized empty Git repository in /woodpecker/src/git.example.com/keval/a/.git/
+ git config --global --replace-all safe.directory /woodpecker/src/git.example.com/keval/a
+ git remote add origin https://git.example.com/keval/a.git
+ git fetch --no-tags --depth=1 --filter=tree:0 origin +49d20190e4d712d6bd0ed36a771fde165feaee67:
From https://git.example.com/keval/a
 * branch 49d20190e4d712d6bd0ed36a771fde165feaee67 -> FETCH_HEAD
+ git reset --hard -q 49d20190e4d712d6bd0ed36a771fde165feaee67
+ git submodule update --init --recursive --depth=1 --recommend-shallow
Submodule 'assets/b' (https://git.example.com/keval/b.git) registered for path 'assets/b'
Cloning into '/woodpecker/src/git.example.com/keval/a/assets/b'...
Submodule path 'assets/b': checked out '27ca3abfff9c496fe3c8e969f32a057814c14e88'
+ git lfs fetch
fetch: Fetching reference refs/heads/main
+ git lfs checkout

assets/b/lfs.png is still an LFS text file

The following 2 commands fix the problem:

git submodule foreach git lfs pull
git submodule foreach git lfs checkout

But this could probably be tuned

Say I have repo A and repo B. Repo A includes repo B as a submodule. Repo B has an lfs-stored png. Using the default clone behaviour, the LFS PNG in repo B is not checked out when running a workflow on repo A. ``` + git init -b main Initialized empty Git repository in /woodpecker/src/git.example.com/keval/a/.git/ + git config --global --replace-all safe.directory /woodpecker/src/git.example.com/keval/a + git remote add origin https://git.example.com/keval/a.git + git fetch --no-tags --depth=1 --filter=tree:0 origin +49d20190e4d712d6bd0ed36a771fde165feaee67: From https://git.example.com/keval/a * branch 49d20190e4d712d6bd0ed36a771fde165feaee67 -> FETCH_HEAD + git reset --hard -q 49d20190e4d712d6bd0ed36a771fde165feaee67 + git submodule update --init --recursive --depth=1 --recommend-shallow Submodule 'assets/b' (https://git.example.com/keval/b.git) registered for path 'assets/b' Cloning into '/woodpecker/src/git.example.com/keval/a/assets/b'... Submodule path 'assets/b': checked out '27ca3abfff9c496fe3c8e969f32a057814c14e88' + git lfs fetch fetch: Fetching reference refs/heads/main + git lfs checkout ``` `assets/b/lfs.png` is still an LFS text file The following 2 commands fix the problem: ``` git submodule foreach git lfs pull git submodule foreach git lfs checkout ``` But this could probably be tuned
Commenting is not possible because the repository is archived.
No Branch/Tag specified
main
v1.0.2
v1.0.1
v1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
crow-plugins/clone#113
Reference in a new issue
crow-plugins/clone
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?