vcs

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StubMetadata = Metadata{
		Remote: urlStringToRemote("https://github.com/c3xdev/c3x"),
		Branch: Branch{
			Name: "stub-branch",
		},
		Commit: Commit{
			SHA:         "stub-sha",
			AuthorName:  "stub-author",
			AuthorEmail: "stub@stub.com",
			Time:        time.Time{},
			Message:     "stub-message",
		},
	}

	MetadataFetcher = newMetadataFetcher()
)

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name string
}

type Commit

type Commit struct {
	SHA         string
	AuthorName  string
	AuthorEmail string
	Time        time.Time
	Message     string

	ChangedObjects []string
	GitDiffTarget  *string
}

Commit defines information for a given commit. This information is normally populated from the local VCS environment. Attributes can be overwritten by CI specific properties and variables.

type Metadata

type Metadata struct {
	Remote      Remote
	Branch      Branch
	Commit      Commit
	BaseCommit  Commit
	PullRequest *PullRequest
	Pipeline    *Pipeline
}

Metadata holds a snapshot of information for a given environment and VCS system. PullRequest and Pipeline properties are only populated if running in a CI system.

func (Metadata) HasChanges

func (m Metadata) HasChanges() bool

type Pipeline

type Pipeline struct {
	ID string
}

Pipeline holds information about a specific run for a CI system. This is used to aggregate C3X metadata across commands used in the same pipeline.

type PullRequest

type PullRequest struct {
	ID           string
	VCSProvider  string
	Title        string
	Author       string
	Labels       []string
	SourceBranch string
	BaseBranch   string
	URL          string
}

PullRequest defines information that is unique to a pull request or merge request in a CI system.

type Remote

type Remote struct {
	Host string
	Name string
	URL  string
}

Remote holds information about the upstream repository that the git project uses.

Jump to

Keyboard shortcuts

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