gitguard
supports to avoid mix of code written by human and code generated by program.
To install cli, simply run:
go get github.com/akm/gitguard
Make sure your PATH includes the $GOPATH/bin directory so your commands can be easily used:
export PATH=$PATH:$GOPATH/bin
Run your command after gitguard
.
If the workspace is clean, your command will be run. If not, your command won't be run and show messages like this:
$ gitguard foo bar baz
[gitguard] There are files that need to be committed first.
[gitguard] git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: gitguard.go
At first, install gom.
go get github.com/mattn/gom
Build for current platform
gom build
$ rm -rf pkg/
$ mkdir -p pkg/
$ vendor/bin/gox -output="pkg/{{.Dir}}_{{.OS}}_{{.Arch}}"
$ export VERSION=[v0.0.1]
$ vendor/bin/ghr $VERSION pkg/
$ git tag $VERSION
$ git push origin --tags