Last active
October 5, 2019 15:25
-
-
Save mdwhatcott/90a5ff084384ff7a9663c00a9e0cf1b7 to your computer and use it in GitHub Desktop.
test && commit || revert (a la Kent Beck)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# TCR: test && commit || revert | |
# codified by Kent Beck | |
# https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864 | |
function test() { | |
echo | |
cd `git rev-parse --show-toplevel` | |
go test ./... | |
} | |
function commit() { | |
echo | |
git add . | |
git commit -m "tcr" | |
} | |
function revert() { | |
echo | |
git reset --hard | |
} | |
test && commit || revert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment