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/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9Entrypoint
Return Type
Git !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| gitDir | Directory | - | Optional git directory to use |
| dir | Directory | - | Optional working directory |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 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 🔗
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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
directoryfunc (m *MyModule) Example() *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| component | String | - | Optional component tag prefix |
| commit | String | - | Optional commit sha to get tags for |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tag-latestfunc (m *MyModule) Example() *dagger.GitVersionTag {
return dag.
Git().
VersionTagLatest()
}@function
def example() -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| component | String | - | Optional component tag prefix |
| commit | String | - | Optional commit sha to get tags for |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tagsfunc (m *MyModule) Example() []*dagger.GitVersionTag {
return dag.
Git().
VersionTags()
}@function
def example() -> List[dagger.GitVersionTag]:
return (
dag.git()
.version_tags()
)@func()
example(): GitVersionTag[] {
return dag
.git()
.versionTags()
}branches() 🔗
Return Type
[Branch ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| commit | String | - | Optional commit sha to get branches for |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
branchesfunc (m *MyModule) Example() []*dagger.GitBranch {
return dag.
Git().
Branches()
}@function
def example() -> List[dagger.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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
headfunc (m *MyModule) Example() *dagger.GitCommit {
return dag.
Git().
Head()
}@function
def example() -> dagger.GitCommit:
return (
dag.git()
.head()
)@func()
example(): GitCommit {
return dag
.git()
.head()
}commit() 🔗
Return Type
Commit !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
commit --ref stringfunc (m *MyModule) Example(ref string) *dagger.GitCommit {
return dag.
Git().
Commit(ref)
}@function
def example(ref: str) -> dagger.GitCommit:
return (
dag.git()
.commit(ref)
)@func()
example(ref: string): GitCommit {
return dag
.git()
.commit(ref)
}mergeBase() 🔗
Return Type
Commit !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | No description provided |
| ref2 | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
merge-base --ref string --ref-2 stringfunc (m *MyModule) Example(ref string, ref2 string) *dagger.GitCommit {
return dag.
Git().
MergeBase(ref, ref2)
}@function
def example(ref: str, ref2: str) -> dagger.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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
dirtyfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| filename | String ! | - | No description provided |
| ref | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
file-at --filename string --ref stringfunc (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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tag-latest \
tagfunc (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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tag-latest \
componentfunc (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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tag-latest \
versionfunc (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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tag-latest \
commitfunc (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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
version-tag-latest \
datefunc (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 moduleFunction GitBranch.branch is not accessible from the git moduleFunction GitBranch.branch is not accessible from the git moduleFunction GitBranch.branch is not accessible from the git modulecommit() 🔗
The commit hash.
Return Type
String ! Example
Function GitBranch.commit is not accessible from the git moduleFunction GitBranch.commit is not accessible from the git moduleFunction GitBranch.commit is not accessible from the git moduleFunction GitBranch.commit is not accessible from the git moduleCommit 🔗
commit() 🔗
The commit hash.
Return Type
String ! Example
dagger -m github.com/felipepimentel/daggerverse/essentials/git@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
merge-base --ref string --ref-2 string \
commitfunc (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@fb937bbd0b1bafe1af04cd7c2ec0ffc4f1d50ad9 call \
merge-base --ref string --ref-2 string \
datefunc (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()
}