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/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f

Entrypoint

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
gitDirDirectory -Optional git directory to use
dirDirectory -Optional working directory
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
func (m *myModule) example() *Git  {
	return dag.
			Git()
}
@function
def example() -> dag.Git:
	return (
		dag.git()
	)
@func()
example(): Git {
	return dag
		.git()
}

Types

Git 🔗

Git is an opinionated helper for performing various commands on our dagger repo.

directory() 🔗

Return Type
Directory !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 directory
func (m *myModule) example() *Directory  {
	return dag.
			Git().
			Directory()
}
@function
def example() -> dagger.Directory:
	return (
		dag.git()
		.directory()
	)
@func()
example(): Directory {
	return dag
		.git()
		.directory()
}

versionTagLatest() 🔗

VersionTagLatests gets the latest version tag for a given component

Return Type
VersionTag !
Arguments
NameTypeDefault ValueDescription
componentString -Optional component tag prefix
commitString -Optional commit sha to get tags for
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tag-latest
func (m *myModule) example() *GitVersionTag  {
	return dag.
			Git().
			VersionTagLatest()
}
@function
def example() -> dag.GitVersionTag:
	return (
		dag.git()
		.version_tag_latest()
	)
@func()
example(): GitVersionTag {
	return dag
		.git()
		.versionTagLatest()
}

versionTags() 🔗

VersionTags gets all version tags for a given component - the resulting versions are sorted in ascending order

Return Type
[VersionTag ! ] !
Arguments
NameTypeDefault ValueDescription
componentString -Optional component tag prefix
commitString -Optional commit sha to get tags for
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tags
func (m *myModule) example() []*GitVersionTag  {
	return dag.
			Git().
			VersionTags()
}
@function
def example() -> List[dag.GitVersionTag]:
	return (
		dag.git()
		.version_tags()
	)
@func()
example(): GitVersionTag[] {
	return dag
		.git()
		.versionTags()
}

branches() 🔗

Return Type
[Branch ! ] !
Arguments
NameTypeDefault ValueDescription
commitString -Optional commit sha to get branches for
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 branches
func (m *myModule) example() []*GitBranch  {
	return dag.
			Git().
			Branches()
}
@function
def example() -> List[dag.GitBranch]:
	return (
		dag.git()
		.branches()
	)
@func()
example(): GitBranch[] {
	return dag
		.git()
		.branches()
}

head() 🔗

Return Type
Commit !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 head
func (m *myModule) example() *GitCommit  {
	return dag.
			Git().
			Head()
}
@function
def example() -> dag.GitCommit:
	return (
		dag.git()
		.head()
	)
@func()
example(): GitCommit {
	return dag
		.git()
		.head()
}

commit() 🔗

Return Type
Commit !
Arguments
NameTypeDefault ValueDescription
refString !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 commit --ref string
func (m *myModule) example(ref string) *GitCommit  {
	return dag.
			Git().
			Commit(ref)
}
@function
def example(ref: str) -> dag.GitCommit:
	return (
		dag.git()
		.commit(ref)
	)
@func()
example(ref: string): GitCommit {
	return dag
		.git()
		.commit(ref)
}

mergeBase() 🔗

Return Type
Commit !
Arguments
NameTypeDefault ValueDescription
refString !-No description provided
ref2String !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 merge-base --ref string --ref-2 string
func (m *myModule) example(ref string, ref2 string) *GitCommit  {
	return dag.
			Git().
			MergeBase(ref, ref2)
}
@function
def example(ref: str, ref2: str) -> dag.GitCommit:
	return (
		dag.git()
		.merge_base(ref, ref2)
	)
@func()
example(ref: string, ref2: string): GitCommit {
	return dag
		.git()
		.mergeBase(ref, ref2)
}

dirty() 🔗

Return whether the current git state is dirty

Return Type
Boolean !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 dirty
func (m *myModule) example(ctx context.Context) bool  {
	return dag.
			Git().
			Dirty(ctx)
}
@function
async def example() -> bool:
	return await (
		dag.git()
		.dirty()
	)
@func()
async example(): Promise<boolean> {
	return dag
		.git()
		.dirty()
}

fileAt() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
filenameString !-No description provided
refString !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 file-at --filename string --ref string
func (m *myModule) example(ctx context.Context, filename string, ref string) string  {
	return dag.
			Git().
			FileAt(ctx, filename, ref)
}
@function
async def example(filename: str, ref: str) -> str:
	return await (
		dag.git()
		.file_at(filename, ref)
	)
@func()
async example(filename: string, ref: string): Promise<string> {
	return dag
		.git()
		.fileAt(filename, ref)
}

VersionTag 🔗

tag() 🔗

The raw tag

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tag-latest \
 tag
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Git().
			VersionTagLatest().
			Tag(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.version_tag_latest()
		.tag()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.versionTagLatest()
		.tag()
}

component() 🔗

The component this belongs to.

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tag-latest \
 component
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Git().
			VersionTagLatest().
			Component(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.version_tag_latest()
		.component()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.versionTagLatest()
		.component()
}

version() 🔗

The semver version for this component.

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tag-latest \
 version
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Git().
			VersionTagLatest().
			Version(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.version_tag_latest()
		.version()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.versionTagLatest()
		.version()
}

commit() 🔗

The commit hash.

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tag-latest \
 commit
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Git().
			VersionTagLatest().
			Commit(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.version_tag_latest()
		.commit()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.versionTagLatest()
		.commit()
}

date() 🔗

The creator date. Distinct from author date, and not to be confused with the underlying commit date.

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 version-tag-latest \
 date
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Git().
			VersionTagLatest().
			Date(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.version_tag_latest()
		.date()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.versionTagLatest()
		.date()
}

Branch 🔗

branch() 🔗

The raw branch

Return Type
String !
Example
Function GitBranch.branch is not accessible from the git module
Function GitBranch.branch is not accessible from the git module
Function GitBranch.branch is not accessible from the git module
Function GitBranch.branch is not accessible from the git module

commit() 🔗

The commit hash.

Return Type
String !
Example
Function GitBranch.commit is not accessible from the git module
Function GitBranch.commit is not accessible from the git module
Function GitBranch.commit is not accessible from the git module
Function GitBranch.commit is not accessible from the git module

Commit 🔗

commit() 🔗

The commit hash.

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 merge-base --ref string --ref-2 string \
 commit
func (m *myModule) example(ctx context.Context, ref string, ref2 string) string  {
	return dag.
			Git().
			MergeBase(ref, ref2).
			Commit(ctx)
}
@function
async def example(ref: str, ref2: str) -> str:
	return await (
		dag.git()
		.merge_base(ref, ref2)
		.commit()
	)
@func()
async example(ref: string, ref2: string): Promise<string> {
	return dag
		.git()
		.mergeBase(ref, ref2)
		.commit()
}

date() 🔗

The commit commit date. Distinct from the author date.

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@ab10ea471baa7d9cf24de2615d39a1055186cc1f call \
 merge-base --ref string --ref-2 string \
 date
func (m *myModule) example(ctx context.Context, ref string, ref2 string) string  {
	return dag.
			Git().
			MergeBase(ref, ref2).
			Date(ctx)
}
@function
async def example(ref: str, ref2: str) -> str:
	return await (
		dag.git()
		.merge_base(ref, ref2)
		.date()
	)
@func()
async example(ref: string, ref2: string): Promise<string> {
	return dag
		.git()
		.mergeBase(ref, ref2)
		.date()
}