You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up in a discussion on #1019: Doing shallow Git clones can speed up vendoring extremely. Since vendoring will throw away the Git history anyway there is no point in pulling in the whole history in the first place.
Expected Behavior
atmos vendor pull could be quicker for Git repos.
Use Case
Improve people's life by improving the speed of atmos vendor pull per default.
Describe Ideal Solution
Check each Git vendor URL if the query parameter depth was specified.
2a. If no such parameter was given (eg. git::https://github.com/cloudposse/atmos.git?ref=v1.158.0) add depth=1 to the query parameters (ie. git::https://github.com/cloudposse/atmos.git?ref=v1.158.0&depth=1).
2b. If such a parameter was given and the value is empty (eg. just git::https://github.com/cloudposse/atmos.git?depth=&ref=v1.158.0) treat this as an override to pull the whole history and remove that empty parameter (ie. git::https://github.com/cloudposse/atmos.git?ref=v1.158.0).
2c. Otherwise: Just keep the depth which was probably specified for some good reason (eg. git::https://github.com/cloudposse/atmos.git?depth=10&ref=v1.158.0)
One thing to watch out for: I am not sure if shallow clones work without a ref. So maybe the existence of the ref query parameter has to be checked in step 1 as well.
Alternatives Considered
Just don't do this.
Additional Context
We use vendoring excessively. Here are some totally unscientific number of our default config (shallow clones via with depth=1) and with full clones:
# rm -rf components/terraform/
# time atmos vendor pull | wc -l
54
real 0m30,154s
user 0m3,870s
sys 0m3,282s
# sed -i -e 's/depth=1&//' vendor/*.yaml
# rm -rf components/terraform/
# time atmos vendor pull | wc -l
54
real 1m12,948s
user 0m8,421s
sys 0m4,575s
The text was updated successfully, but these errors were encountered:
Describe the Feature
This came up in a discussion on #1019: Doing shallow Git clones can speed up vendoring extremely. Since vendoring will throw away the Git history anyway there is no point in pulling in the whole history in the first place.
Expected Behavior
atmos vendor pull
could be quicker for Git repos.Use Case
Improve people's life by improving the speed of
atmos vendor pull
per default.Describe Ideal Solution
depth
was specified.2a. If no such parameter was given (eg.
git::https://github.com/cloudposse/atmos.git?ref=v1.158.0
) adddepth=1
to the query parameters (ie.git::https://github.com/cloudposse/atmos.git?ref=v1.158.0&depth=1
).2b. If such a parameter was given and the value is empty (eg. just
git::https://github.com/cloudposse/atmos.git?depth=&ref=v1.158.0
) treat this as an override to pull the whole history and remove that empty parameter (ie.git::https://github.com/cloudposse/atmos.git?ref=v1.158.0
).2c. Otherwise: Just keep the depth which was probably specified for some good reason (eg.
git::https://github.com/cloudposse/atmos.git?depth=10&ref=v1.158.0
)One thing to watch out for: I am not sure if shallow clones work without a
ref
. So maybe the existence of theref
query parameter has to be checked in step 1 as well.Alternatives Considered
Just don't do this.
Additional Context
We use vendoring excessively. Here are some totally unscientific number of our default config (shallow clones via with
depth=1
) and with full clones:The text was updated successfully, but these errors were encountered: