git

package
v0.0.0-...-eb599cc Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MirrorDirectory = "mirror"

MirrorDirectory is the name of the directory inside the cache directory to which the git repo is cloned.

Variables

This section is empty.

Functions

func CurrentHash

func CurrentHash(short bool) (string, error)

CurrentHash returns the hash of the current git commit

func Dir

func Dir() string

Dir returns the full path of the git repo

func Init

func Init(revision string) error

Init clones the repo if necessary and checks out the given revision

func ShortHash

func ShortHash(commit string) (string, error)

ShortHash returns the short hash of the given commit

Types

type Commit

type Commit struct {
	ShortHash string
	TitleLine string
}

Commit represents a commit as told by git log

func Log

func Log(from, to, path string) ([]*Commit, error)

Log returns commits for the path between the range given

type Repository

type Repository struct {
	Dir    string
	Remote string
}

Repository represents a git repository

Jump to

Keyboard shortcuts

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