Implement a `git` repository time checkout rule
This project provides a git_checkout
execution time rule using the fetched objects from git_fetch
.
However, if a user is fetching a Bazel project they need it at repository time, not execution time for the BUILD.bazel
to be parsed.
This is a ticket to implement a hermetic git
repository rule that performs a repository time checkout of the working copy.
There is not a requirement to be compatible with the upstream git_repository and should follow the same API as download_utils
where possible. To prevent confusion it may make sense to name it something different.
It should re-use the git_fetch
repository rule to share the downloaded git
objects.
A strawperson API:
git_fetch(
name = "something",
urls = ["..."],
)
# Creating a repository time working tree of the commit that was fetched
git_worktree(
name = "checkout",
objects = "@something",
)
Later, we could provide a git_repository
that combines both rules and conforms to the upstream API.