Skip to main content

git_fetch

name

def name(
*,
name: str,
default_target_platform: None | str = ...,
target_compatible_with: list[str] = ...,
compatible_with: list[str] = ...,
exec_compatible_with: list[str] = ...,
visibility: list[str] = ...,
within_view: list[str] = ...,
metadata: OpaqueMetadata = ...,
tests: list[str] = ...,
modifiers: OpaqueMetadata = ...,
_apple_platforms: dict[str, str] = ...,
_git_fetch_tool: str = ...,
allow_cache_upload: bool = ...,
contacts: list[str] = ...,
default_host_platform: None | str = ...,
labels: list[str] = ...,
licenses: list[str] = ...,
repo: str,
rev: str,
sub_targets: list[str] = ...,
) -> None

Checkout a commit from a git repository.

Parameters

  • name: name of the target
  • default_target_platform: specifies the default target platform, used when no platforms are specified on the command line
  • target_compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with a configuration
  • compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with a configuration
  • exec_compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with an execution platform
  • visibility: a list of visibility patterns restricting what targets can depend on this one
  • within_view: a list of visibility patterns restricting what this target can depend on
  • metadata: a key-value map of metadata associated with this target
  • tests: a list of targets that provide tests for this one
  • modifiers: an array of modifiers associated with this target
  • allow_cache_upload: Whether the results of the fetch can be written to the action cache and CAS.
  • repo: Url suitable as a git remote.
  • rev: 40-digit hex SHA-1 of the git commit.
  • sub_targets: A list of paths within the remote repo to be made accessible as sub-targets. For example if we have a git_fetch with name = "serde.git" and sub_targets = ["serde_derive"], then other targets would be able to refer to the serde_derive subdirectory of the repo as ":serde.git[serde_derive]".

Details

Examples:

git_fetch(
name = "serde.git",
repo = "https://github.com/serde-rs/serde",
rev = "fccb9499bccbaca0b7eef91a3a82dfcb31e0b149",
)