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

Add SparseVerb --add #81

Merged
merged 1 commit into from
Aug 23, 2019
Merged

Conversation

wilbaker
Copy link
Member

@wilbaker wilbaker commented Aug 22, 2019

Resolves #76

  • Added SparseVerb to Scalar
  • SparseVerb supports adding folders to the sparse-checkout with --add and --add-stdin
  • SparseVerb add prefetches the requested folders before calling git sparse-checkout add with the specified folders

TODO

  • Wire-up a call to git sparse-checkout add
  • Add support for providing folders over stdin

@wilbaker
Copy link
Member Author

@derrickstolee there is still some work to do here, but I'm putting my current changes up in a PR in case you want to pick this work up before I get back to it.

Sample output with the current changes:

~/ScalarTest/src>git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   License.md

no changes added to commit (use "git add" and/or "git commit -a")
~/ScalarTest/src>
~/ScalarTest/src>
~/ScalarTest/src>~/Repos/GSD/Publish/scalar sparse --add GVFS/GVFS
Running git status...Failed

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   License.md

no changes added to commit (use "git add" and/or "git commit -a")

git status reported that you have dirty files
Either commit your changes or reset and clean
sparse was aborted
~/ScalarTest/src>git checkout -- License.md 
~/ScalarTest/src>~/Repos/GSD/Publish/scalar sparse --add GVFS/GVFS
Running git status...Succeeded
All requested files are already available. Nothing new to prefetch.
~/ScalarTest/src>~/Repos/GSD/Publish/scalar sparse --add Scripts/
Running git status...Succeeded
Authenticating...Succeeded
Querying remote for config...Succeeded
Configured cache server: None (https://gvfs.visualstudio.com/ci/_git/ForTests)
Fetching blobs from origin (no cache server)...Succeeded

Stats:
  Matched blobs:    13
  Already cached:   13
  Downloaded:       0
~/ScalarTest/src>

Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the progress! Just a few ideas for the future direction.

Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
Scalar/CommandLine/SparseVerb.cs Outdated Show resolved Hide resolved
@derrickstolee
Copy link
Contributor

@wilbaker now that #54 is merged, you can rebase this topic onto master and start using the git sparse-checkout add command.

@wilbaker
Copy link
Member Author

@derrickstolee thanks for feedback! I am going to push a few more commits while this is still WIP, and then clean up the commit history before removing the WIP.

@wilbaker wilbaker force-pushed the scalar_sparse_verb branch 2 times, most recently from ef3d456 to 63af101 Compare August 23, 2019 17:51
@wilbaker
Copy link
Member Author

Sample run with current changes:

~>cd ScalarTests/src
~/ScalarTests/src>git sparse-checkout list
/*
!/*/*
~/ScalarTests/src>~/Repos/GSD/Publish/scalar sparse --add "GVFS/GVFS.GVFlt;GVFS/GVFS"
Authenticating...Succeeded
Querying remote for config...Succeeded
Configured cache server: None (https://gvfs.visualstudio.com/ci/_git/ForTests)
Fetching blobs from origin (no cache server)...Succeeded

Stats:
  Matched blobs:    67
  Already cached:   67
  Downloaded:       0
~/ScalarTests/src>git sparse-checkout list
/*
!/*/*
/GVFS/*
!/GVFS/*/*
/GVFS/GVFS/*
/GVFS/GVFS.GVFlt/*
~/ScalarTests/src>~/Repos/GSD/Publish/scalar sparse --add-stdin
Scripts
GitHooksLoader
Authenticating...Succeeded
Querying remote for config...Succeeded
Configured cache server: None (https://gvfs.visualstudio.com/ci/_git/ForTests)
Fetching blobs from origin (no cache server)...Succeeded

Stats:
  Matched blobs:    21
  Already cached:   21
  Downloaded:       0
~/ScalarTests/src>git sparse-checkout list
/*
!/*/*
/GVFS/*
!/GVFS/*/*
/GVFS/GVFS/*
/GVFS/GVFS.GVFlt/*
/GitHooksLoader/*
/Scripts/*
~/ScalarTests/src>

@wilbaker
Copy link
Member Author

@derrickstolee the functional tests are still running but this PR is ready for another look 😄

I squashed my changes down to a single commit.

@wilbaker wilbaker requested a review from jrbriggs August 23, 2019 18:04
Copy link
Contributor

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wilbaker This looks good to me. It doesn't seem to collide with #84 at all, and would unblock @jeschu1 to build more tests as part of #78.

@wilbaker wilbaker merged commit 512464d into microsoft:master Aug 23, 2019
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.

Sparse: Update SparseVerb to interact with git sparse-checkout add, drop other uses
2 participants