terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Git depth example

Open runephilosof-karnovgroup opened this issue 1 year ago • 3 comments

Terraform Version

main

Affected Pages

https://github.com/hashicorp/terraform/blob/0c509183d165c2d317a9e27e31c0a213f4cb3cdd/website/docs/language/modules/sources.mdx#L263

What is the docs issue?

It would be nice with an example of what is meant by The depth URL argument.

Proposal

Something like

source = "git::https://example.com/vpc.git?depth=1&ref=v1.2.0"

References

No response

Thanks for this request!

crw avatar Feb 14 '24 18:02 crw

The issue sounds good as it makes sense to include an example to make people understand the shallow clones.

The depth URL argument mentioned in the statement corresponds to the --depth argument of the git clone command. By specifying the depth parameter in the URL when cloning a repository, you instruct Git to create a shallow clone with the commit history truncated to only the specified number of commits.

For example, if you want to perform a shallow clone with only the last 3 commits of a repository, you would use the depth=3 parameter in the clone URL. This would fetch only the most recent 3 commits along with the necessary data, making the clone faster and more efficient, especially for large repositories.

I can fix the documentation

vinod827 avatar Feb 17 '24 10:02 vinod827

Opened the PR# https://github.com/hashicorp/terraform/pull/34692

vinod827 avatar Feb 17 '24 11:02 vinod827

Closed by https://github.com/hashicorp/terraform/pull/34692

kmoe avatar Mar 07 '24 21:03 kmoe

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Apr 07 '24 02:04 github-actions[bot]