-
Notifications
You must be signed in to change notification settings - Fork 13
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 ability to use filter arguments #19
Conversation
That is nice! Please ignore CI failure of |
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.
LGTM
Could you please just fix docs?
FILTER_ARG="--no-filter" | ||
if [ -n "$FILTER" ]; then | ||
FILTER_ARG="--filter=$FILTER" | ||
fi | ||
|
||
$GIT -c protocol.version=2 fetch --no-tags --prune --progress "$FILTER_ARG" --depth=1 origin +${REF}:refs/remotes/origin/${REF} |
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.
NOTE
I couldn't find the --filter
/ --no-filter
options in git fetch
command, but it seems to be available as same as git clone
command.
https://stackoverflow.com/questions/68084224/can-you-apply-a-filter-to-git-fetch
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.
git fetch --filter=blob:none
sets config below in fact.
[remote "origin"]
url = https://github.com/snow-actions/sparse-checkout.git
fetch = +refs/heads/*:refs/remotes/origin/*
promisor = true
partialclonefilter = blob:none
git fetch --no-filter
is
[remote "origin"]
url = https://github.com/snow-actions/sparse-checkout.git
fetch = +refs/heads/*:refs/remotes/origin/*
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.
I could commit :)
Thank you for PR!
This is useful if you have a large mono repo, with a massive history & don't want to clone down all objects;
allows you to pass in
--filter=blob:none
to the command to reduce the amount of objects git would try to fetch;