vcs

package
v0.0.0-...-ef490db Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package vcs stores helper for getting vcs information

Index

Constants

View Source
const (
	// don't have status or don't care status.
	StatusNone     = -1
	StatusClean    = 0
	StatusUntrack  = 1
	StatusUnstage  = 1 << 1
	StatusUncommit = 1 << 2
)

Variables

This section is empty.

Functions

func RegisterVCS

func RegisterVCS(v VCS)

Types

type VCS

type VCS interface {
	GetVCSInfo(path string, user *user.User, conf *config.Config) *VCSInfo
}

type VCSInfo

type VCSInfo struct {
	// git or "", "" means not a repo
	RepoType string
	// git branch name, git commit id, hg bookmark
	Name string
	// git status, hg status
	Status int
}

func GetVCSInfo

func GetVCSInfo(path string, user *user.User, conf *config.Config) *VCSInfo

func (*VCSInfo) StatusDirty

func (s *VCSInfo) StatusDirty() bool

Directories

Path Synopsis
Package git contains vcs info for git
Package git contains vcs info for git
Package hg contains vcs info for hg
Package hg contains vcs info for hg

Jump to

Keyboard shortcuts

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