versioncontrol

package
v0.0.0-...-16aecd9 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package versioncontrol is a simplified/stripped down version of go/internal/get/vcs that is aimed at the simplier temporary git clone needed for OpenFaaS template fetch.

Index

Constants

This section is empty.

Variables

View Source
var GitCheckRefName = &vcsCmd{
	name:   "Git",
	cmd:    "git",
	cmds:   []string{"check-ref-format --allow-onelevel {refname}"},
	scheme: []string{"git", "https", "http", "git+ssh", "ssh"},
}

GitCheckRefName defines the command that validates if a string is a valid reference name or sha

View Source
var GitCheckout = &vcsCmd{
	name:   "Git",
	cmd:    "git",
	cmds:   []string{"-C {dir} checkout {refname}"},
	scheme: []string{"git", "https", "http", "git+ssh", "ssh"},
}

GitCheckout defines the command to clone a specific REF of repo into a directory

View Source
var GitClone = &vcsCmd{
	name:   "Git",
	cmd:    "git",
	cmds:   []string{"clone {repo} {dir} --depth=1 --config core.autocrlf=false -b {refname}"},
	scheme: []string{"git", "https", "http", "git+ssh", "ssh"},
}

GitClone defines the command to clone a repo into a directory

View Source
var GitCloneDefault = &vcsCmd{
	name:   "Git",
	cmd:    "git",
	cmds:   []string{"clone {repo} {dir} --depth=1 --config core.autocrlf=false"},
	scheme: []string{"git", "https", "http", "git+ssh", "ssh"},
}

GitClone defines the command to clone the default branch of a repo into a directory

View Source
var GitInitRepo = &vcsCmd{
	name: "Git",
	cmd:  "git",
	cmds: []string{
		"init {dir}",
		"config core.autocrlf false",
		"config user.email \"contact@openfaas.com\"",
		"config user.name \"OpenFaaS\"",
		"add {dir}",
		"commit -m \"Test-commit\"",
	},
	scheme: []string{"git", "https", "http", "git+ssh", "ssh"},
}

GitInitRepo initializes the working directory add commit all files & directories

Functions

func GetGitBranch

func GetGitBranch() string

func GetGitDescribe

func GetGitDescribe() string

GetGitDescribe returns the human readable name for the current commit using `git-describe`

func GetGitSHA

func GetGitSHA() string

GetGitSHA returns the short Git commit SHA from local repo

func IsGitRemote

func IsGitRemote(repoURL string) bool

IsGitRemote validates if the supplied string is a valid git remote url value

func IsPinnedGitRemote

func IsPinnedGitRemote(repoURL string) bool

IsPinnedGitRemote validates if the supplied string is a valid git remote url value

func ParsePinnedRemote

func ParsePinnedRemote(repoURL string) (remoteURL, refName string)

ParsePinnedRemote returns the remote url and contraint value from repository url

Types

This section is empty.

Jump to

Keyboard shortcuts

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