ZOSOpenTools / meta

Meta repository to tie together the various underlying z/OS Open Source tools (ZOT) repositories here
https://zosopentools.github.io/meta/
Apache License 2.0
37 stars 26 forks source link

Sparse checkout option for `zopen build` #618

Open AnthonyGiorgio opened 7 months ago

AnthonyGiorgio commented 7 months ago

I'm working with the z/OS Tools & Toys repo, which is very large due to a lot of non-code content that is stored there. All the code is stored in a single subdirectory, so it would be nice if I could tell zopen to only checkout the contents of that directory. It would speed up the clone process as well as reducing disk space on my build system.

IgorTodorovskiIBM commented 7 months ago

I propose inventing new zopen vars for this, ZOPEN_STABLE_SUBDIRS/ZOPEN_STABLE_SUBDIRS:

export ZOPEN_STABLE_URL="https://github.com/git/git"
export ZOPEN_STABLE_DEPS="curl git make m4 perl autoconf automake help2man texinfo xz zlib openssl expat gettext gzip tar coreutils zoslib diffutils ncurses bash sed libpcre2"
export ZOPEN_STABLE_SUBDIRS="dir1 dir2"

If set, it zopen build would run these commands:

git clone -n --depth=1 --filter=tree:0 $repo $dir
cd $dir
git sparse-checkout set --no-cone $ZOPEN_STABLE_SUBDIRS
git checkout
v1gnesh commented 7 months ago

Adding a few links on the topic probably for my own future reference. https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/ https://github.blog/2020-01-13-highlights-from-git-2-25/#sparse-checkout-management-made-easy

https://github.blog/2021-11-10-make-your-monorepo-feel-small-with-gits-sparse-index/ https://github.blog/2021-11-15-highlights-from-git-2-34/#sparse-index

v1gnesh commented 7 months ago

The madness continues... there's something called 'partial clone' too 😵‍💫 https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/