|
1 |
| -// Package vcs provides the ability to work with varying version control systems (VCS), |
2 |
| -// also known as source control systems (SCM) though the same interface. |
| 1 | +// Package vcs provides the ability to work with varying version control systems |
| 2 | +// (VCS), also known as source control systems (SCM) though the same interface. |
| 3 | +// |
| 4 | +// This package includes a function that attempts to detect the repo type from |
| 5 | +// the remote URL and return the proper type. For example, |
| 6 | +// |
| 7 | +// remote := "https://github.com/Masterminds/go-vcs" |
| 8 | +// local, _ := ioutil.TempDir("", "go-vcs") |
| 9 | +// repo, err := NewRepo(remote, local) |
| 10 | +// |
| 11 | +// In this case repo will be a GitRepo instance. NewRepo can detect the VCS for |
| 12 | +// numerous popular VCS and from the URL. For example, a URL ending in .git |
| 13 | +// that's not from one of the popular VCS will be detected as a Git repo and |
| 14 | +// the correct type will be returned. |
| 15 | +// |
| 16 | +// If you know the repository type and would like to create an instance of a |
| 17 | +// specific type you can use one of constructors for a type. They are NewGitRepo, |
| 18 | +// NewSvnRepo, NewBzrRepo, and NewHgRepo. The definition and usage is the same |
| 19 | +// as NewRepo. |
| 20 | +// |
| 21 | +// Once you have an object implementing the Repo interface the operations are |
| 22 | +// the same no matter which VCS you're using. There are some caveats. For |
| 23 | +// example, each VCS has its own version formats that need to be respected and |
| 24 | +// checkout out branches, if a branch is being worked with, is different in |
| 25 | +// each VCS. |
3 | 26 | package vcs
|
4 | 27 |
|
5 | 28 | import (
|
|
28 | 51 | // of the provided logger.
|
29 | 52 | var Logger *log.Logger = log.New(ioutil.Discard, "go-vcs", log.LstdFlags)
|
30 | 53 |
|
31 |
| -// VcsType descripbes the type of VCS |
| 54 | +// VcsType describes the type of VCS |
32 | 55 | type VcsType string
|
33 | 56 |
|
34 | 57 | // VCS types
|
|
0 commit comments