Dagger
Search

git

This module has been generated via dagger init and serves as a reference to
basic 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.1.1

Entrypoint

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-Git repository directory (must include .git)
imageRegistryString "docker.io"Git image registry
imageRepositoryString "alpine/git"Git image repositroy
imageTagString "2.52.0"Git image tag
containerUserString "65532"Git image user
Example
dagger -m github.com/riftonix/daggerverse/git@5c510f0e7332b0e6f6027989d5dcbd387f2e2fb4 call \
 --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.Git  {
	return dag.
			Git(source)
}
@function
def example(source: dagger.Directory, ) -> dagger.Git:
	return (
		dag.git(source)
	)
@func()
example(source: Directory, ): Git {
	return dag
		.git(source)
}

Types

Git 🔗

container() 🔗

Creates container with configured git

Return Type
Container !
Example
dagger -m github.com/riftonix/daggerverse/git@5c510f0e7332b0e6f6027989d5dcbd387f2e2fb4 call \
 --source DIR_PATH container
func (m *MyModule) Example(source *dagger.Directory) *dagger.Container  {
	return dag.
			Git(source).
			Container()
}
@function
def example(source: dagger.Directory, ) -> dagger.Container:
	return (
		dag.git(source)
		.container()
	)
@func()
example(source: Directory, ): Container {
	return dag
		.git(source)
		.container()
}

getChangedDirs() 🔗

Return changed paths inside diff_path between target_branch and HEAD

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
targetBranchString !"master"Target branch or ref to diff against
diffPathString "."Path to scope the diff (relative to repo root)
Example
dagger -m github.com/riftonix/daggerverse/git@5c510f0e7332b0e6f6027989d5dcbd387f2e2fb4 call \
 --source DIR_PATH get-changed-dirs --target-branch string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, targetBranch string) []string  {
	return dag.
			Git(source).
			GetChangedDirs(ctx, targetBranch)
}
@function
async def example(source: dagger.Directory, target_branch: str) -> List[str]:
	return await (
		dag.git(source)
		.get_changed_dirs(target_branch)
	)
@func()
async example(source: Directory, targetBranch: string): Promise<string[]> {
	return dag
		.git(source)
		.getChangedDirs(targetBranch)
}