git-lfs/CONTRIBUTING.md

163 lines
7.3 KiB
Markdown
Raw Normal View History

2015-03-19 19:30:55 +00:00
## Contributing to Git Large File Storage
Hi there! We're thrilled that you'd like to contribute to this project. Your
help is essential for keeping it great.
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.md).
2016-05-10 14:45:02 +00:00
This project adheres to the [Open Code of Conduct](./CODE-OF-CONDUCT.md). By participating, you are expected to uphold this code.
## Feature Requests
Feature requests are welcome, but will have a much better chance of being
accepted if they meet the first principles for the project. Git LFS is intended
2015-06-19 15:40:28 +00:00
for end users, not Git experts. It should fit into the standard workflow as
much as possible, and require little client configuration.
* Large objects are pushed to Git LFS servers during git push.
* Large objects are downloaded during git checkout.
* Git LFS servers are linked to Git remotes by default. Git hosts can support
users without requiring them to set up anything extra. Users can access
different Git LFS servers like they can with different Git remotes.
* Upload and download requests should use the same form of authentication built
into Git: SSH through public keys, and HTTPS through Git credential helpers.
* Git LFS servers use a JSON API designed around progressive enhancement.
Servers can simply host off cloud storage, or implement more efficient methods
of transferring data.
You can see what the Git LFS team is prioritizing work on in the
[roadmap](./ROADMAP.md).
## Project Management
The Git LFS project is managed completely through this open source project and
its [chat room][chat]. The [roadmap][] shows the high level items that are
prioritized for future work. Suggestions for major features should be submitted
as a pull request that adds a markdown file to `docs/proposals` discussing the
feature. This gives the community time to discuss it before a lot of code has
been written. Roadmap items are linked to one or more Issue task lists ([example][roadmap-items]), with the `roadmap` label, that go into more detail.
2016-11-15 17:07:11 +00:00
[chat]: https://gitter.im/git-lfs/git-lfs
[roadmap]: ./ROADMAP.md
2016-11-15 17:07:11 +00:00
[roadmap-items]: https://github.com/git-lfs/git-lfs/issues/490
The Git LFS teams mark issues and pull requests with the following labels:
* `bug` - An issue describing a bug.
2016-02-25 18:03:32 +00:00
* `core-team` - An issue relating to the governance of the project.
* `enhancement` - An issue for a possible new feature.
* `review` - A pull request ready to be reviewed.
* `release` - A checklist issue showing items marked for an upcoming release.
* `roadmap` - A checklist issue with tasks to fulfill something from the
[roadmap](./ROADMAP.md)
## Branching strategy
In general, contributors should develop on branches based off of `master` and pull requests should be to `master`.
## Submitting a pull request
0. [Fork][] and clone the repository
0. Configure and install the dependencies: `make`
0. Make sure the tests pass on your machine: `make test`
0. Create a new branch based on `master`: `git checkout -b <my-branch-name> master`
0. Make your change, add tests, and make sure the tests still pass
0. Push to your fork and [submit a pull request][pr] from your branch to `master`
0. Pat yourself on the back and wait for your pull request to be reviewed
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
* Follow the [style guide][style] where possible.
* Write tests.
* Update documentation as necessary. Commands have [man pages](./docs/man).
* Keep your change as focused as possible. If there are multiple changes you
would like to make that are not dependent upon each other, consider submitting
them as separate pull requests.
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
## Building
### Prerequisites
Git LFS depends on having a working Go 1.11.0+ environment, with your standard
`$GOROOT` and `$GOPATH` environment variables set.
On RHEL etc. e.g. Red Hat Enterprise Linux Server release 7.2 (Maipo), you will neet the minimum packages installed to build Git LFS:
```
$ sudo yum install gcc
$ sudo yum install perl-Digest-SHA
```
In order to run the RPM build `rpm/build_rpms.bsh` you will also need to:
`$ sudo yum install ruby-devel`
(note on an AWS instance you may first need to `sudo yum-config-manager --enable rhui-REGION-rhel-server-optional`)
### Building Git LFS
The easiest way to download Git LFS for making changes is `go get`:
2016-11-15 17:07:11 +00:00
$ go get github.com/git-lfs/git-lfs
This clones the Git LFS repository to your `$GOPATH`. If you typically keep
your projects in a specific directory, you can symlink it from `$GOPATH`:
$ cd ~/path/to/your/projects
2016-11-15 17:07:11 +00:00
$ ln -s $GOPATH/src/github.com/git-lfs/git-lfs
From here, run `make` to build Git LFS in the `./bin` directory. Before
submitting changes, be sure to run the Go tests and the shell integration
tests:
$ make test # runs just the Go tests
2018-07-13 17:43:13 +00:00
$ cd t && make test # runs the shell tests in ./test
$ script/cibuild # runs everything, with verbose debug output
## Updating 3rd party packages
all: use Go Modules instead of Glide Since we are now building on Go 1.11 (as of 074a2d4f (all: use Go 1.11 in CI, 2018-08-28)) and Go 1.11 supports Go Modules [1], let's stop using Glide, and begin using Go Modules. This involves a few things: * Teach the Makefile how to build go.sum files instead of glide.lock files. * Teach continuous integration services to build Git LFS in a non-$GOPATH environment, since (without setting GO111MODULE=on explicitly, which we choose not to do), this will break compiling Git LFS, because Go 1.11 will ignore modules present in a Go checkout beneath $GOPATH. * In order to do the above, let's also make sure that we are un-setting $GOCACHE in the environment, as this causes Go to work without modules support [2]. * Because we're no longer building in a `$GOPATH`-based location, let's instruct the CircleCI base image to archive the new location, too. * Similarly, teach the RPM spec to build in a non-$GOPATH location. * By contrast, since we use dh_golang to build git-lfs binaries on Debian, let's wait until the upstream dh_golang package is released with support for Go 1.11 module support explicitly. Therefore, force GO111MODULE to be on so that we can build a copy of Git LFS whose checkout is within a $GOPATH. Although the go.mod versions match the glide.yaml ones, the diff attached is large because Go Modules do not vendor `_test.go` files, whereas Glide does. [1]: https://golang.org/doc/go1.11#modules [2]: `GOCACHE=on` will be deprecated in Go 1.12, so this change makes sense for that reason, too. Co-authored-by: brian m. carlson <bk2204@github.com>
2018-08-28 20:53:57 +00:00
0. Update `go.mod`.
0. Run `make vendor` to update the code in the `vendor` directory.
2015-03-19 19:30:55 +00:00
0. Commit the change. Git LFS vendors the full source code in the repository.
0. Submit a pull request.
2015-04-02 21:57:52 +00:00
## Releasing
If you are the current maintainer:
2016-11-15 17:07:11 +00:00
* Create a [new draft Release](https://github.com/git-lfs/git-lfs/releases/new).
2015-04-02 21:57:52 +00:00
List any changes with links to related PRs.
* Make sure your local dependencies are up to date: `make vendor`
* Ensure that tests are green: `script/cibuild`
2016-11-15 17:07:11 +00:00
* Bump the version in `lfs/lfs.go`, [like this](https://github.com/git-lfs/git-lfs/commit/dd17828e4a6f2394cbba8621037199dc28f046e8).
* Add the new version to the top of CHANGELOG.md
* Build for all platforms with `make release` (you need Go setup for
2015-04-02 21:57:52 +00:00
cross compiling with Mac, Linux, FreeBSD, and Windows support).
* Test the command locally. The compiled version will be in `bin/releases/{os}-{arch}/git-lfs-{version}/git-lfs`
2016-11-15 17:07:11 +00:00
* Get the draft Release ID from the GitHub API: `curl -in https://api.github.com/repos/git-lfs/git-lfs/releases`
2015-04-02 21:57:52 +00:00
* Run `script/release -id {id}` to upload all of the compiled binaries to the
release.
* Publish the Release on GitHub.
2016-11-15 17:07:11 +00:00
* Update [Git LFS website](https://github.com/git-lfs/git-lfs.github.com/blob/gh-pages/_config.yml#L4)
(release engineer access rights required).
2015-07-09 20:52:17 +00:00
* Ping external teams on GitHub:
* @github/desktop
* Build packages:
* rpm
* apt
2016-11-15 17:07:11 +00:00
* Bump homebrew version and generate the homebrew hash with `curl --location https://github.com/git-lfs/git-lfs/archive/vx.y.z.tar.gz | shasum -a 256` ([example](https://github.com/Homebrew/homebrew-core/pull/413/commits/dc0eb1f62514f48f3f5a8d01ad3bea06f78bd566))
* Create release branch for bug fixes, such as `release-1.5`.
* Increment version in `config/version.go` to the next expected version. If
v1.5 just shipped, set the version in master to `1.6-pre`, for example.
2015-04-02 21:57:52 +00:00
## Resources
- [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)
- [Using Pull Requests](https://help.github.com/articles/using-pull-requests/)
- [GitHub Help](https://help.github.com)
2016-11-15 17:07:11 +00:00
[fork]: https://github.com/git-lfs/git-lfs/fork
[pr]: https://github.com/git-lfs/git-lfs/compare
[style]: https://github.com/golang/go/wiki/CodeReviewComments