git
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/riftonix/daggerverse/git@v0.2.0Entrypoint
Return Type
Git !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Git repository directory (must include .git) |
| imageRegistry | String | "docker.io" | Git image registry |
| imageRepository | String | "alpine/git" | Git image repositroy |
| imageTag | String | "2.52.0" | Git image tag |
| containerUser | String | "65532" | Git image user |
Example
dagger -m github.com/riftonix/daggerverse/git@4e89f1f5067e7ef4d3758764622ab4d616f1e882 call \
func (m *MyModule) Example() *dagger.Git {
return dag.
Git()
}@function
def example() -> dagger.Git:
return (
dag.git()
)@func()
example(): Git {
return dag
.git()
}Types
Git 🔗
container() 🔗
Creates container with configured git
Return Type
Container ! Example
dagger -m github.com/riftonix/daggerverse/git@4e89f1f5067e7ef4d3758764622ab4d616f1e882 call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Git().
Container()
}@function
def example() -> dagger.Container:
return (
dag.git()
.container()
)@func()
example(): Container {
return dag
.git()
.container()
}getChangedPaths() 🔗
Return changed paths inside diff_path between target_branch and HEAD
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| targetBranch | String ! | "master" | Target branch or ref to diff against |
| diffPath | String | "." | Path to scope the diff (relative to repo root) |
Example
dagger -m github.com/riftonix/daggerverse/git@4e89f1f5067e7ef4d3758764622ab4d616f1e882 call \
get-changed-paths --target-branch stringfunc (m *MyModule) Example(ctx context.Context, targetBranch string) []string {
return dag.
Git().
GetChangedPaths(ctx, targetBranch)
}@function
async def example(target_branch: str) -> List[str]:
return await (
dag.git()
.get_changed_paths(target_branch)
)@func()
async example(targetBranch: string): Promise<string[]> {
return dag
.git()
.getChangedPaths(targetBranch)
}