-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for git sparse checkout #122
Conversation
Config for repo now has an optional entry 'sparse' which only has an effect for git repositories. The value is the name of the file (relative to the parent repo) to be used for sparsification. * Updated tests to reflect new config key. Note: No tests were added for Git sparse checokout. Existing tests were simply updated to ensure that a field entry for sparse was available in all relevant tests.
@gold2718 please fix travis-ci tests |
Note - I was hoping to take a stab at this over the weekend. I'm still not sure how to do such a test in a way that does not involve creating and destroying repositories. Presumably if I look at the existing tests, I'll either see how things are mocked or get more comfortable with a heavy weight test. |
@tclune, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a cursory look, looks good. (Sorry for the delay: I was on vacation last week.)
I had a quiet day and thought I would return to this issue. I presume it has not been merged because of the decrease in coverage, and have investigated. The few new lines of code that are not exercised are print statements activated when verbose is on. I tried modifying the existing test to use
I tried to follow the examples from the other tests, but those are all using verbose_args after the initial clone. What is the correct course of action here? Note - I'm happy to add additional tests, but until I understand this issue, none will increase the code coverage to the best of my understanding. |
@tclune, I have been meaning to try and figure out what is wrong with our test coverage. I agree that something is messed up. For instance, when I added the test for sparse checkout, the coverage went down. I think it is not worth further holding this PR for as I will not be able to look into this for at least another month. |
Add support for git sparse checkout
Added a new, optional external property, sparse. sparse points to a file (relative to external repository local directory) with git sparse checkout patterns (e.g., directory names to include).
If the sparse keyword is included, enable sparse checkout for that repository and use git read-tree to perform the sparse checkout.
Added a new test for sparse checkout. The test is a repo with two externals which are both tag2 of the simple_ext repo with one of them configured for a sparse checkout. The test makes sure that both externals have the correct files.
Updated the documentation for the externals configuration file.
User interface changes?: Yes
New sparse keyword is optional with a blank default value which preserves current functionality.
Fixes: #120
Testing:
test removed: None
unit tests: All passed
system tests: All passed, including new test for sparse feature
manual testing: Several manual tests of NASA test cases.