https://github.com/sourcegraph/go-vcs
manipulate and inspect VCS repositories in Go
https://github.com/sourcegraph/go-vcs
Last synced: 7 months ago
JSON representation
manipulate and inspect VCS repositories in Go
- Host: GitHub
- URL: https://github.com/sourcegraph/go-vcs
- Owner: sourcegraph
- License: other
- Created: 2013-06-02T02:36:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-07-17T07:36:21.000Z (over 2 years ago)
- Last Synced: 2025-05-04T04:39:22.532Z (7 months ago)
- Language: Go
- Homepage: https://sourcegraph.com/sourcegraph/go-vcs
- Size: 768 KB
- Stars: 80
- Watchers: 83
- Forks: 20
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-cn - go-vcs - vcs) (版本控制 / 实用程序/Miscellaneous)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go - ★ 65 (Version Control)
- awesome-go - go-vcs - | - | - | (Version Control / HTTP Clients)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- awesome-go-zh - go-vcs
- awesome-go-plus - go-vcs - manipulate and inspect VCS repositories in Go.  (Version Control / Utility/Miscellaneous)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- fucking-awesome-go - :octocat: go-vcs - manipulate and inspect VCS repositories in Go. :star: 42 :fork_and_knife: 11 (Version Control / Advanced Console UIs)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- awesome-go - sourcegraph/go-vcs
- awesome-go-with-stars - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- fucking-awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Utility/Miscellaneous)
- awesome-Char - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / HTTP Clients)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / HTTP Clients)
- awesome-go-cn - go-vcs - vcs) (版本控制 / 实用程序/Miscellaneous)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / HTTP Clients)
- awesome-go-cn - go-vcs
- awesome-go-extra - go-vcs - 06-02T02:36:18Z|2021-03-31T12:37:46Z| (Version Control / Fail injection)
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go-cn - go-vcs
- awesome-go - go-vcs - manipulate and inspect VCS repositories in Go. (Version Control / Advanced Console UIs)
README
go-vcs - manipulate and inspect VCS repositories
================================================
go-vcs is a library for manipulating and inspecting VCS repositories in Go. It currently supports
Git and Mercurial (hg).
Note: the public API is experimental and subject to change until further notice.
* [View on Sourcegraph](https://sourcegraph.com/github.com/sourcegraph/go-vcs/-/def/GoPackage/github.com/sourcegraph/go-vcs/vcs/-/Repository)
[](https://travis-ci.org/sourcegraph/go-vcs)
[](https://godoc.org/sourcegraph.com/sourcegraph/go-vcs/vcs#Repository)
Resolving dependencies
======================
For hg blame, you need to install hglib: `pip install python-hglib`.
Installing
==========
```
go get -u sourcegraph.com/sourcegraph/go-vcs/vcs
```
Implementation differences
==========================
The goal is to have all supported backends at feature parity, but until then, consult this table for implementation differences.
| Feature | git | gitcmd | hg | hgcmd |
|---------------------------------------|----------------------|--------------------|----------------------|----------------------|
| vcs.CommitsOptions.Path | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
| vcs.BranchesOptions.MergedInto | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
| vcs.BranchesOptions.IncludeCommit | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
| vcs.BranchesOptions.BehindAheadBranch | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
| vcs.Repository.Committers | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
| vcs.FileLister | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
| vcs.UpdateResult | :white_large_square: | :white_check_mark: | :white_large_square: | :white_large_square: |
Contributions that fill in the gaps are welcome!
Development
===========
### First-time installation of protobuf and other codegen tools
You need to install and run the protobuf compiler before you can regenerate Go code after you change the `vcs.proto` file.
1. **Install protoc**, the protobuf compiler. Find more details in the [protobuf README](https://github.com/google/protobuf).
On OS X, you can install it with Homebrew by running:
```
brew install --devel protobuf
```
Then make sure the `protoc` binary is in your `$PATH`.
2. **Install [gogo/protobuf](https://github.com/gogo/protobuf)**.
```
go get -u github.com/gogo/protobuf/...
```
3. **Install `gopathexec`**:
```
go get -u sourcegraph.com/sourcegraph/gopathexec
```
### Regenerating Go code after changing `vcs.proto`
```
go generate sourcegraph.com/sourcegraph/go-vcs/vcs/...
```
### Running tests
Run `go test ./vcs/...`.
Contributors
============
* Quinn Slack
See all contributors [here](https://github.com/sourcegraph/go-vcs/graphs/contributors).