gitmap – github.com/bep/gitmap Index | Files

package gitmap

import "github.com/bep/gitmap"

Index

Variables

var (
	GitNotFound = errors.New("Git executable not found in $PATH")
)

Types

type GitInfo

type GitInfo struct {
	Hash            string    `json:"hash"`            // Commit hash
	AbbreviatedHash string    `json:"abbreviatedHash"` // Abbreviated commit hash
	Subject         string    `json:"subject"`         // The commit message's subject/title line
	AuthorName      string    `json:"authorName"`      // The author name, respecting .mailmap
	AuthorEmail     string    `json:"authorEmail"`     // The author email address, respecting .mailmap
	AuthorDate      time.Time `json:"authorDate"`      // The author date
	CommitDate      time.Time `json:"commitDate"`      // The commit date
}

GitInfo holds information about a Git commit.

type GitMap

type GitMap map[string]*GitInfo

GitMap maps filenames to Git revision information.

type GitRepo

type GitRepo struct {
	// TopLevelAbsPath contains the absolute path of the top-level directory.
	// This is similar to the answer from "git rev-parse --show-toplevel"
	// except symbolic link is not followed on non-Windows platforms.
	// Note that this follows Git's way of handling paths, so expect to get forward slashes,
	// even on Windows.
	TopLevelAbsPath string

	// The files in this Git repository.
	Files GitMap
}

func Map

func Map(repository, revision string) (*GitRepo, error)

Map creates a GitRepo with a file map from the given repository path and revision. Use blank or HEAD as revision for the currently active revision.

Source Files

gitmap.go

Version
v1.3.0
Published
Apr 23, 2022
Platform
js/wasm
Imports
7 packages
Last checked
now

Tools for package owners.