Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sparse] squash and rebase #6169 sparse checkout support #26

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

VinnyOG
Copy link

@VinnyOG VinnyOG commented Aug 5, 2022

Squashed and rebased this PR libgit2#6169.

Will report investigation as I test sparse functionality locally.

  • get libgit2 test running
  • verify that all test pass
  • verify existing g8 tests pass
  • write new g8 tests for sparse repos / update some existing ones to add this curveball in
  • make list of features that core git supports with sparse checkout
  • verify which of these are supported and which are not with this PR
  • make a list of work that needs to be done in order for this to be 8th Wall ready

Observations

(g8 refers to a non-sparse support build and ng8 refers to a build with this PR included)

Becoming sparse

Starting in a clone of the code8 repo, i executed this command on master git sparse-checkout init --cone.

g8 takes a few seconds and shows all files as deleted and ng8 returns quickly with no changes.
Here, we notice that top-level files are included by default but there are no directories.

➜  niantic-code8 git:(sparsetesting) l
total 440
drwxr-xr-x  32 pawelczarnecki  staff   1.0K Aug 10 09:35 .
drwxr-xr-x  14 pawelczarnecki  staff   448B Jul 21 14:23 ..
-rw-r--r--   1 pawelczarnecki  staff   3.4K Aug 10 09:28 .bazelrc
-rw-r--r--   1 pawelczarnecki  staff     6B Apr 25 11:39 .bazelversion
-rw-r--r--   1 pawelczarnecki  staff   2.0K Apr  1 09:49 .clang-format
-rw-r--r--   1 pawelczarnecki  staff   4.9K Apr 25 11:39 .eslintrc.js
drwxr-xr-x  15 pawelczarnecki  staff   480B Aug 10 09:35 .git
-rw-r--r--   1 pawelczarnecki  staff    87K Apr 25 11:39 .gitattributes
-rw-r--r--   1 pawelczarnecki  staff   1.2K Aug 10 09:28 .gitignore
-rw-r--r--   1 pawelczarnecki  staff    28B Apr  1 09:49 .pylintrc
-rw-r--r--   1 pawelczarnecki  staff     0B Apr 25 11:39 BUILD
-rwxr-xr-x   1 pawelczarnecki  staff   2.2K Apr  1 09:50 PRBuilder.py
-rwxr-xr-x   1 pawelczarnecki  staff   220B Apr  1 09:50 PRESUBMIT
-rw-r--r--   1 pawelczarnecki  staff   2.7K Aug 10 09:28 README.md
-rw-r--r--   1 pawelczarnecki  staff    26K Aug 10 09:28 WORKSPACE
-rwxr-xr-x   1 pawelczarnecki  staff   1.3K Apr  1 09:50 awe-build-install.sh
-rw-r--r--   1 pawelczarnecki  staff   1.5K Apr 25 11:39 c8.natvis
-rwxr-xr-x   1 pawelczarnecki  staff   1.4K Aug 10 09:28 cache-builder.sh
-rw-r--r--   1 pawelczarnecki  staff   2.2K Aug 10 09:28 code8-gcp-readers.json
-rw-r--r--   1 pawelczarnecki  staff    71B Apr  1 09:50 code8_config.py
-rw-r--r--   1 pawelczarnecki  staff   128B Apr 25 11:39 eslint-local-rules.js
-rwxr-xr-x   1 pawelczarnecki  staff   742B Aug 10 09:28 hello-build-builder.sh
-rwxr-xr-x   1 pawelczarnecki  staff   282B Apr  1 09:50 linecount.sh
-rwxr-xr-x   1 pawelczarnecki  staff   1.7K Aug 10 09:28 nightly-builder.sh
-rw-r--r--   1 pawelczarnecki  staff   827B Apr 25 11:39 package.json
-rw-r--r--   1 pawelczarnecki  staff   2.5K Aug 10 09:28 platform_mappings
-rwxr-xr-x   1 pawelczarnecki  staff   382B Apr  1 09:50 presubmit-lint.sh
-rwxr-xr-x   1 pawelczarnecki  staff   513B Apr  1 09:50 presubmit.sh
-rwxr-xr-x   1 pawelczarnecki  staff   2.0K Aug 10 09:28 reality-builder.sh
-rw-r--r--   1 pawelczarnecki  staff    62B Apr  1 09:50 setup.cfg
-rw-r--r--   1 pawelczarnecki  staff     0B Aug 10 09:28 test_file_delete
-rw-r--r--   1 pawelczarnecki  staff   667B Apr 25 11:39 tsconfig.json

Adding sparse entries.

➜  niantic-code8 git:(sparsetesting) git sparse-checkout add reality/cloud/xrhome
➜  niantic-code8 git:(sparsetesting) git status
On branch sparsetesting
Your branch is up to date with 'origin/pawelczarnecki-sparsetesting'.

You are in a sparse checkout with 13% of tracked files present.

nothing to commit, working tree clean
➜  niantic-code8 git:(sparsetesting) ng8 status
➜  niantic-code8 git:(sparsetesting) l
total 440
( ... removed regular files)
drwxr-xr-x   4 pawelczarnecki  staff   128B Aug 10 09:41 reality

Syncing

When I synced, every file in the repo was checked out again.
Added GIT_CHECKOUT_REMOVE_SPARSE_FILES to the checkout_options.strategy everywhere we do a checkout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant