Skip to content

Commit

Permalink
Automate commit testing with proper stashing
Browse files Browse the repository at this point in the history
Add a installation instructions for a git hook to automate testing
done on each commit.  Promotes proper handling of edge cases
related to testing code that will not be in the commit, which masks
errors that show up later as a nasty surprise.

Fully opt in, links to a gist on github.
  • Loading branch information
glfmn committed May 22, 2018
1 parent 12308f6 commit 050d0e5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ $ cd git2-rs
$ cargo build
```

### Automating Testing

Running tests and handling all of the associated edge cases on every commit
proves tedious very quickly. To automate tests and handle proper stashing and
unstashing of unstaged changes and thus avoid nasty surprises, use the
pre-commit hook found [here][pre-commit-hook] and place it into the
`.git/hooks/` with the name `pre-commit`. You may need to add execution
permissions with `chmod +x`.


To skip tests on a simple commit or doc-fixes, use `git commit --no-verify`.

## Building on OSX 10.10+

Currently libssh2 requires linking against OpenSSL, and to compile libssh2 it
Expand Down Expand Up @@ -55,3 +67,5 @@ at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in git2-rs by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.

[pre-commit-hook]: https://gist.github.com/glfmn/0c5e9e2b41b48007ed3497d11e3dbbfa

0 comments on commit 050d0e5

Please sign in to comment.