-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Options like sparse mode #172
Comments
FWIW, Travis CI also supports sparse checkout, described at https://docs.travis-ci.com/user/customizing-the-build#git-sparse-checkout It would be even better to have full-fledged partial-clone though. |
However doesn't solve the files-outside-of-the-user’s-work-area-in-the-tree problem. |
It might be a good idea to add |
For now I'm using this
Not ideal but still saves quite a bit of time in my case |
Not sure whether you are aware of the partial clone feature? It is still somewhat experimental, and I would be loathe to risk overloading our servers (especially during COVID-19, when we're running at or over capacity, human-wise), but maybe it would be worth playing with it for a few moments (in coordination with @github/git-core and @github/git-systems, maybe)? |
In git 2.26 partial clone does not play well with --depth, causing massive regression |
Right, I saw some discussion on the Git mailing list, but I wasn't able to monitor that (COVID-19 🌧️). The thing is: typically the bulk of the payload consists of blobs. The trees and commits are usually pretty light-weight. In other words, a non-shallow partial clone (that is then populated via a sparse checkout) can be a lot faster than a shallow clone. At least that's what our friends over at Google reported internally. |
And I was the one who brought the topic
I guess it may be true for some class of repositories, but definitely doesn't hold in my case. |
In the context of |
Whoops, I did not realize that you were the one, sorry ;-) |
This is what I did to get partial clone: - name: Partial Clone
run: |
REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git clone --filter=blob:none --no-checkout --depth 1 --sparse $REPO .
git sparse-checkout init --cone
git sparse-checkout add "folder1" "folder2/folder3"
git checkout Incase you want more power over what gets cloned, you might want to avoid the cone option |
You don't really need to set the |
Yeah it's optional, only required if you want to commit and push the changes |
But shouldn't that be configured if/when a commit is to be created, rather than already during the checkout? |
Yep, you are right, I have updated the text, it was only relevant in my case, as I wanted to push the changes as well |
Does anyone know how to checkout the PR in actions? This step only seems to work on push events and not during PR event |
I think you will have to use |
I was looking into those variables, what they were storing. echo ${{ github.head_ref }} -> renovate/playwright-1.x
echo ${{ github.base_ref }} -> master
echo ${{ github.event.pull_request.head.sha }} -> 8795a56fa8a91017e212c0311c17b4e6df1df512
echo ${{ github.event.pull_request.head.ref }} -> renovate/playwright-1.x I can checkout the PR using sha, but pushing the changes to the PR seems to be a problem. And yeah thanks for helping out |
If you want to push to a PR, things get really awkward and sometimes impossible. To push successfully to a PR, you will have to know the URL of the originating repository (there might be a workflow variable to help you with that), but the contributor will also need to have checked the checkbox "Allow edits by maintainers", and then I am still uncertain that |
I didn't really thought of "Allow edits by maintainers" checkbox, just tried out committing to this PR with checkbox unchecked and it give permission denied error at Github desktop You are correct, this will get complicated, I think it's better to wait until sparse mode is added in checkout actions, and anyways I don't really need that right now, but that was a good thing to have as well. Thanks |
Any update here? |
@mambax how about giving it a try yourself? Just
|
🤣 Can do but since the last update was 5 months ago I thought I ask 😭 |
It should be pretty straight-forward.
Right. I only pointed to the part where What I forgot to say is that the git sparse-checkout init --cone
git sparse-checkout add "folder1" "folder2/folder3" Feel free to point me to your code if you get stuck with this. |
I also like to see |
Related issue about support for |
Hi.
GitHub is internally evaluating partial-clone (Actually GitLab already provides the feature!).
This can be useful for a large monorepo with sparse-checkout(see
git sparse-checkout --help
) feature.Thus, hereby I request support to those features.
Thanks.
workaround
Here is a workaround suggestion for folks who want to customize the whole process, though I haven't tested.
The text was updated successfully, but these errors were encountered: