govcs

package module
v0.0.0-...-ba0d244 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 1

README

govcs

govcs is a simple abstraction layer around version control tools. It currently supports Git and Mercurial. With it you can get information about the repository including remotes, branches, commits, etc.

GoDoc

License

GPLv3

Installation

go get bitbucket.org/rw_grim/govcs

Example

This simple example will output the default remote for the repository in the my-src-dir directory.

package main

import(
    "fmt"

    "bitbucket.org/rw_grim/govcs"
)

func main() {
    vcs, err := govcs.Dectect("my-src-dir")
    if err != nil {
        panic(err)
    }

    fmt.Printf("remote: %s\n", vcs.Remote(""))
}

Documentation

Overview

Package govcs is the entry point to using the govcs library.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRepositoryFound = errors.New("no repository found")
)

Functions

func Detect

func Detect(wd string) (vcs.VCS, error)

Detect will try to determine what version control system is in use in the given working directory and return a vcs.VCS instance for it.

Types

This section is empty.

Directories

Path Synopsis
Package exec mocks running commands.
Package exec mocks running commands.
Package git interacts with Git repositories.
Package git interacts with Git repositories.
Package hg interacts with Mercurial repositories.
Package hg interacts with Mercurial repositories.
Package git interacts with Git repositories.
Package git interacts with Git repositories.
Package vcs abstracts VCS interactions.
Package vcs abstracts VCS interactions.

Jump to

Keyboard shortcuts

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