git-info

command module
v0.0.0-...-ad0eb60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

README

Git Info Dagger Module

This is a Dagger module to extract information from a Git repository.

Give it a (local) Git repository path, and it will return the following information:

  • the current branch name
  • the current tag name (if any)
  • the current commit hash
  • the current commit author name
  • the current commit time
  • the current commit message
  • the current "version" (from git-describe)
  • the URL of the remote repository (if any)
  • the name of the repository (the last part of the URL)

You can retrieve these information:

  • in JSON format - as a string output
  • in a Dagger File object, in JSON format
  • in a Dagger Directory object, 1 file per information, in raw format
  • as environment variables, injected in a provided container

Read the documentation at https://daggerverse.dev/mod/github.com/vbehar/daggerverse/git-info.

Usage

Display the information in JSON format:

$ dagger call -m github.com/vbehar/daggerverse/git-info \
	--git-directory=. \
	json
{
  "Ref": "HEAD",
  "Branch": "main",
  "Tag": "v1.2.3",
  "CommitHash": "5735dead51a44ea8d954508d8e36b7facf2f49dd",
  "CommitUser": "Vincent Behar",
  "CommitTime": "2024-10-22T11:16:27+02:00",
  "CommitMessage": "feat: git-info",
  "Version": "v1.2.3",
  "URL": "https://github.com/vbehar/daggerverse",
  "Name": "daggerverse"
}

Documentation

Overview

A Dagger Module to extract information about a git reference.

Easily extract information about a git reference (branch, tag, commit hash, committer, commit time, commit message, version), and expose it as a JSON file, a directory, or environment variables.

Directories

Path Synopsis
examples
go module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL