-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I realized that the git lfs clone speed up does not work with Git Submodules and I wonder if anyone has a clever idea to approach this problem. Here is my first wrapper script attempt:
git-lfs clone $@
if [[ -z $2 ]]; then
CLONE_PATH=$(basename ${1%.git});
else
CLONE_PATH=$2;
fi
pushd "$CLONE_PATH"
git submodule init
wt_prefix=$(git rev-parse --show-prefix)
git submodule--helper list --prefix "$wt_prefix" | {
while read mode sha1 stage sm_path
do
name=$(git submodule--helper name "$sm_path") || exit
url=$(git config submodule."$name".url)
if ! test -d "$sm_path"/.git && ! test -f "$sm_path"/.git
then
git submodule--helper clone --prefix "$wt_prefix" --path "$sm_path" --name "$name" --url "$url"
pushd "$sm_path"
git -c filter.lfs.smudge=cat checkout -q $sha1 || exit
git-lfs pull || exit
popd
fi
done
}
popdThis works by taking the relevant pieces from the git submodule command. However, this is probably a pretty fragile solution. I would prefer to use higher level Submodule commands. @sinbad @stefanbeller any better idea or do you think this is the way to go?
Metadata
Metadata
Assignees
Labels
No labels